Using Matlab:
Write a function m-file to reduce a matrix to a row-echelon form with pivoting. Use this function m-file to reduce the matrices B and C from Lab 4 to a row-echelon form. B = (2 5 -6 6 15 19 10 26 35 -10 11 -47), C = (2 4 -2 6 12 9 10 20 33 -12 -24 -7).
Expert Answer
(a) R = rref(A) produces the reduced row echelon form of A using Gauss Jordan elimination with partial pivoting.
Say a matris is defied as
a = [1 2 3; 4 5 6; 7 8 10]
Output ,
a = 1 2 3 4 5 6 7 8 10
NOw run the command
R = rref(a)
it will give the ouput like
R = 1 0 0 0 1 0 0 0 1
With partial pivoting
(b) Simmilarly for
B = [2 6 10 -10; 5 15 26 11; -6 19 35 -47]
R = rref(B)
Output ::::
R =
1.00000 0.00000 0.00000 10.97297 0.00000 1.00000 0.00000 -65.32432 0.00000 0.00000 1.00000 36.00000
and
C = [2 6 10 -12; 4 12 20 24; -2 9 33 -7]
R = rref(C)
OUTPUT ::::
R = 1.00000 0.00000 -3.60000 0.00000 0.00000 1.00000 2.86667 0.00000 0.00000 0.00000 0.00000 1.00000