Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write a Matlab script file that will import a set of equations from a data fi

ID: 2989869 • Letter: 1

Question

1. Write a Matlab script file that will import a set of equations from a data file, for example, [1, 2,-3; 1,3,4; 2,5,1] [x1;x2;x3] = [1;2;3]   

Find out how many solutions this set has and print it out on screen. If the set has one solution, print out that solution

2. Show an example of histogram plot.

Ok, so far I have this in my script and now I am stuck on how to obtain the solutions and print it out on the screen. I have a feeling it has to do with the command fprintf

1. A = input('nxn Matrix A : ');

2. C= input('1xn Solution vector C: ');

3. disp('A = ')

4. disp(A)

5. disp('C = ')

6. disp(C)

Explanation / Answer

1.

clc;
clear all;
A=[1, 2,-3; 1,3,4; 2,5,1];
B=[1;2;3];
C=[A B]
rnk_c=rank(C);
rnk_A=rank(A);
if(rnk_c==rnk_A)
    solution=linsolve(A,B);
else
    disp('System is Inconsistant, Solution Doesnot Exists');
end

2.

A = input('nxn Matrix A : ');
C= input('1xn Solution vector C: ');
fprintf('A = %d',A);
fprintf('C = %d',C);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote