I wanted to compute the following matrix in Matlab:
g=[I
A
.
.
.
A^N]
I used the following program in Matlab:
A=[2 3;4 1];
s=A;
for n=1:1:50
s(n)=A.^n;
end
g=[eye(1,1),s];
I am getting the following error:
In an assignment
A(I) = B
, the number of elements inB
andI
must be the same.
Error ins_x_calcu_v1
(line 5)
s(n)=A.^n;