Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE DO NOT USE MATLABS max function for partial pivoting. Part 1 - Gauss Elimination Function Develop a MATLAB function called GaussElimination that solves a
PLEASE DO NOT USE MATLABS "max" function for partial pivoting. Part Gauss Elimination Function
Develop a MATLAB function called GaussElimination that solves a given system of linear equations of the form using the Gauss Elimination method. The function should take three input arguments, which must be listed in this order: the coefficient matrix the rightside vector and a truefalse value. If the third value is true, the function should perform partial pivoting while solving the linear system. If the third value is false, the function should not perform partial pivoting. The function should return the vector You must create your own implementation of the Gauss Elimination method; you may not use MATLAB's builtin matrix solvers eg you may not use the left division operator However, while developing your code, you may want to use the builtin matrix solvers to check the answers your code produces.
Refer to the pseudo code form lecture which shows where partial pivoting is performing during Gauss Elimination. You should place a conditional statement containing the partial pivoting code there. If a value of true is received in the input, the partial pivoting code should be executed, otherwise it should not.
gaussAb : Performs Gauss elimination to solve for in
Input:
coefficient matrix nxn
right hand side vector
Output:
solution vector
Confirm that the coefficient matrix is square
if is not square
stop execution and return an error value: NaN
end
setup augmented matrix
Number of columns
do not use matlabs MAX function for partial pivoting
back substitution
initialize solution vector set all to zero
for down to
for to
end
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started