loopsexample1 - a(i) = 5 + (i-1)/10; A(3,1) = a(i); ans =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Parametric solution to a matrix equation clear all A = zeros(3); b = zeros(3,1); A = [3,4,-5;1,-3,2;0,1,-1]; %initialize the A matrix b = [2;5;1]; %write the the b vector x = 0; y = 0; z = 0; a = 0; %initialize the output variables for i = 1:51
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a(i) = 5 + (i-1)/10; A(3,1) = a(i); ans = inv(A)*b; % solve the matrix for this value of a x(i) = ans(1); %writhe the first component of the ans vector in x y(i) = ans(2); z(i) = ans(3); end plot(a,x,a,y,a,z)...
View Full Document

Ask a homework question - tutors are online