Question: Can you help me please doing this assignment (MATLAB) Problem 1.4 Write a function named istref that returns 1 if the input matrix is in
Can you help me please doing this assignment (MATLAB)



Problem 1.4 Write a function named istref that returns 1 if the input matrix is in reduced row echelon form and 0 if it is not. Note that for all but the last assessment pretest is available. That is, you can check that your function produces the correct results before submitting your solutions. N.B. Once your click submit your solution is final and no further corrections are possible. 2 1 function result = isrref(A) result = 1; % assume A is rref until determined otherwise [m n] = size(A); previousleadingzeros = -1; 3 4 5 6 for row=1:m 7 8 % Determines the number of leading zeros in the row leadingzeros = 0; 9 10 11 12 13 for col=1:n if Arow,col) break; 14 end 15 leadingzeros = leadingzeros + 1; end 16 17 18 19 2e 21 22 23 % Makes appropriate tests if row has pivot if leadingzeros
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
