Question

Perform the following tasks/questions in separate MATLAB cells (label cells as task/question numbers). Note the first cell (unnumbered) should be your Name, section number and the version of this Assignment. Tasks follow:

Perform the following tasks/questions in separate MATLAB cells (label cells as task/question numbers). Note the first cell (u

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find required MATLAB code along with necessary details in comments:

clear all; clc; close all;

k=[4:0.05:6.90]; % possible values of k
N=numel(k); % number of elements in k
results=zeros(3,N); % initial matrix for storing results
for w=1:N
kval=k(w);   
% given matrix of A
A=[kval 0 -16 9; -3 1 4 -2; 2 -3 4 -4];
temp=rref(A); % find the solution
results(:,w)=temp(:,end);   
end
% Plot the data
plot(k,results(1,:),'b-');
hold on
plot(k,results(2,:),'r-');
plot(k,results(3,:),'m-');
legend('x_0','x_1','x_2');
xlabel('k'); ylabel('variables x_0, x_1, x_2')

==================== SCREENSHOT OF CODE

main-script.m ×1+ clear all clc: close all: 烂[4 : 0 . 05: 6·90] ; N=numel (k) ; results=zeros (3,N); for w=1 : N 롬 possible v

========================== SAMPLE OUTPUT

7 6 .5 k 5 4 0 6 4

Add a comment
Know the answer?
Add Answer to:
Perform the following tasks/questions in separate MATLAB cells (label cells as task/question numbers). Note the first cell (unnumbered) should be your Name, section number and the version of this Assi...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT