Please can anyone help with matlab codes on how to concatenate or carry out sequential multiplication of n number of say 2 by 2 matrices in matlab.
I want to use the knowledge to cascade multiple T matrices .
Thanks
What i mean is something like this : A1*A2*A3*A4*A5*...*An
Where A1, A2 are complex 2 by 2 matrices such as : 0.0123+0.0345i 0.0334+0.0878i
0.0345-0.0988i 0.0998-0.08767i
N = 10; % arbitrary number of matrices
myArray = zeros(2,2,N); % create an array of N 2x2 matrices. real/complex doesn't matter
product = eye(2); % initialize product to be 1 (identity matrix)
for j=1:length(myArray)
product = product * myArray,:,j);
end
product
Thanks so much for your effort so far.I am grateful.Please could you help me further on how to use that codes you sent and apply it to a matrix say
A1=[0.2408-0.0056918i -0.75918-0.0049211i ; 0.75918+0.0049211i 1.7592+0.010552i]
.
.
.
A10 =[0.2408-0.0056918i -0.75918-0.0049211i ; 0.75918+0.0049211i 1.7592+0.010552i]
i.e say 10 same matrices as above .
If it is to be done for 10 different matrices does the program differ from above ?
Thanks
Thanks for your patience.What i wanted to do is to have a code that can multiply sequentially large number of same matrix upto 1000 i.e say A1,A2,A3....AN = [0.9987+0.6544i 0.0877+0.0766i;0.0987+0.0977i 0.0087+0.0987i] without having to write out one by one the matrices i want to multiply.
Thanks
Thanks.I have tried the codes but the matlab is pointing error signs at the dots ... used to represent repetition of matrices upto 10.It like there is a problem with it ?
Does that mean if i am to do for a large number of multiplication of matrices upto say 100 ,i will have to state the matrices a hundred times ? Is there no way to make the computer repeat it itself by just inputing the first and last matrices let say the first one and the last one which is 100 since the matrices are same.
Thanks.
If the matrices are all the same, why don't you just use the power function ?
A = [0.2408-0.0056918i -0.75918-0.0049211i ; 0.75918+0.0049211i 1.7592+0.010552i];
N=100;
product = mpower(A,N);
Thanks for your support the other time.In the multiple matrix answer you gave i.e as shown below :
A = [0.2408-0.0056918i -0.75918-0.0049211i ; 0.75918+0.0049211i 1.7592+0.010552i];
N=100;
product = mpower(A,N);
disp(product)
Is it possible to make the above display the( product )as T1=
T2=
T3=
T4=
which represent the 2 by 2 matrix.Thanks