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:
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
========================== SAMPLE OUTPUT
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...