Matlab Recursion Loop

145 Views Asked by At

I need to create a loop to answer part c of the enter image description herefollowing linear algebra question. I'm new to Matlab so this is extremely confusing. I'm not sure how to make a loop that "counts" from 0-25 in order to generate a new matrix for each value. If someone could help me out it'd be great.

1

There are 1 best solutions below

2
On

Here's how I would do the loop:

A = [1.52, -.7; .56, .4];
x = zeros(2,26);
x(:,1) = [0;1];
for i = 1:25
    x(:,i+1) = A*x(:,i);
end