Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.mimage text in transcribed

use hint:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions