Hello, I am almost finished with an assignment for the course Linear Algebra but I am stuck with the very last part of this one question. We had to create a loop inside a function that would result in (for my case) 225 iterations and thus 225 vectors x in R2. Now we have to transpose these column vectors x into row vectors and make a matrix X that consists of 225 rows with each row being a row vector x. Eventually, we have to plot this matrix with the first column on the x axis and the second column on the y axis. My question is, how to get this output matrix? I have been looking over the internet but every situation seems to differ from mine and can't figure it out. Thank you very much in advance! This is what I already have:
function X=Exercise4(v);v(1)=2; v(2)=0; v(3)=1; v(4)=4; v(5)=2; v(6)=8; v(7)=0;v=[v(1);v(2);v(3);v(4);v(5);v(6);v(7)];%Fill in and create all the matrices given
S=[1,v(4)/5;0,1];a=pi*(v(2)+12)/300;R=[cos(a),-sin(a);sin(a),cos(a)];r=0.97;A=r*S*R*(S^-1);iter=0; x=[v(5)+1;v(6)]; %This is the first value of x (x(0)) that was given in the question
MaxNorm=0.01; %The length of the vector could not be smaller than 0.01
while norm(x)>=MaxNorm x=A*x iter=iter+1 %Count the number of iterations
enddisp('Iterations'); %Display the number of iterations
disp(iter);
Best Answer