Question: I need code problem c Question 2 (opts): Solve the system of linear equation hif 2x+y+4z = 10 x + 2y-5z = 1 3x-2y-4z =
Question 2 (opts): Solve the system of linear equation hif 2x+y+4z = 10 x + 2y-5z = 1 3x-2y-4z = 8 a) using inv or mldivide in Matlab b) Use the function GaussPivot.m function xGaussPivot (A, b) GaussPivot: Gauss elimination pivoting % x-GaussPivot (A,b): Gauss elimination with pivoting. 8 input: A coefficient matrix 8 b-right hand side vector % output: % x-solution vector [m, n]-size (A) nb-n+1: Aug-[A bl 8 forward elimination for k- 1:n-1 for i - k+1:n factor-Aug(i,k) /Aug (k, k) Aug (i, k:nb) -Aug(i, kinb)-factor Aug(k, kinb) end end back substitution x-zeros (n,1) x (n)-Aug (n, nb)/Aug (n, n) for i -n-1:-1:1 x(i) (Aug (i, nb) -Aug (i,i+l:n) *x (i+1:n))/Aug(,i) end c) Modify the code above to Gauss Elimination with Pivoting
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
