Use Matlab to solve this The best way to understand an algor
Use Matlab to solve this.
The best way to understand an algorithm is to work out an example by hand. (a) Using Gaussian elimination, solve [1 1 1 3 1 0 -1 0 1] [x_1 x_2 x_3] = [6 11 -2] Show the intermediate steps. Compute the determinant of the matrix using your forward elimination results. (b) Interchange the second and third equations and repeat part (a).Solution
A= [1 1 1 ; 3 1 0 ; -1 0 1 ] B = [6 ; 11 ; -2] c = [A B]; [m,n] = size(c); rezc = cell(m,1); for j1 = 1:m [Y,ind] = sortrows(abs(c(j1:end,j1:end)),1); c(j1:end,j1:end) = c(j1-1+flipud(ind),j1:end); c1 = c(:,j1)*ones(1,n); c1(j1,:) = zeros(1,n); c2 = (ones(m,1)*c(j1,:)/c(j1,j1)); c(j1,:) = c2(j1,:); c = c - c2.*c1; rezc{j1} = c; end x = c(:,end) b) fo this part A= [1 1 1; -1 0 1;3 1 0] B = [6;-2;11] c = [A B]; [m,n] = size(c); rezc = cell(m,1); for j1 = 1:m [Y,ind] = sortrows(abs(c(j1:end,j1:end)),1); c(j1:end,j1:end) = c(j1-1+flipud(ind),j1:end); c1 = c(:,j1)*ones(1,n); c1(j1,:) = zeros(1,n); c2 = (ones(m,1)*c(j1,:)/c(j1,j1)); c(j1,:) = c2(j1,:); c = c - c2.*c1; rezc{j1} = c; end x = c(:,end) rezc{:} % so rrefmovie rezc{:} % so rrefmovie![Use Matlab to solve this. The best way to understand an algorithm is to work out an example by hand. (a) Using Gaussian elimination, solve [1 1 1 3 1 0 -1 0 1] Use Matlab to solve this. The best way to understand an algorithm is to work out an example by hand. (a) Using Gaussian elimination, solve [1 1 1 3 1 0 -1 0 1]](/WebImages/22/use-matlab-to-solve-this-the-best-way-to-understand-an-algor-1051972-1761548146-0.webp)