of 3
1
4.22 Write a user-defined MATLAB function that solves a system of n linear equations, ,
with the Gauss–Jordan method. The program should include pivoting in which the pivot row is switched
with the row that has a pivot element with the largest absolute numerical value. For the function name and
arguments use x = GaussJordan(a,b), where a is the matrix of coefficients, b is the right-hand-side
column of constants, and x is the solution.
(a) Use the GaussJordan function to solve the system:
a[]x[] b[]=
2x1x24x32x4
++ 19=
56–3–42–1
4
2
3
6.0000