Question: Write matlab code for csolvefull.m use hint: csolve.m is given below: function csolve(A) [m,n] = size(A) pivot = []; free = 1:1:n; R = rref(A);

Write matlab code for csolvefull.m Write matlab code for csolvefull.m use hint: csolve.m is given below:

use hint:

function csolve(A) [m,n] = size(A) pivot = []; free = 1:1:n; R

csolve.m is given below:

function csolve(A) 
[m,n] = size(A) 
pivot = []; free = 1:1:n; R = rref(A); % rref(A) returns reduced row echlon form of A 

for i = 1:m % visit every row for j = 1:n % visit every column if R(i,j) == 1 pivot = [pivot,j]; break; end end end 

free([pivot]) = '';

fprintf('The rank of the coefficient matrix is %d. ', length(pivot)); fprintf('Pivot variables:'); for i = 1:length(pivot) fprintf(' %d', pivot(i)); end fprintf(' '); fprintf('Free variables:'); for i = 1:length(free) fprintf(' %d', free(i)); end fprintf(' '); end 

Submit your m-file and a diary that shows how you tested the code. Modify csolve.m so that it outputs pivot and free. Then call upon this function in csolvefull.m. Submit the m-file for csolvefull.m, but not csolve.nm Create a function csolveful1.m with input matrix A and a column vector b and no output. The function should display the rank, the pivot and free variables of A, the particular solution to Ax - b, and the special solutions for A. Test it using the system below 11 5 826 4 0 2-2-5 15 -36-12 -8 -5 1 3-1 7 6 2 A= Your display should be precisely the following >>csolvefull(A,b) The rank of the coefficient matrix is 3 Pivot variables: 1 2 5 Free variables: 3 4 The particular solution is: -0.4413 -0.0829 0 0.3981 The special solutions are 0.5000 -0.5000 -1.5000 0.5000 1 1.0000 0 1.0000 0.0000 0.0000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!