MATLAB: Extracting square matrices from another matrix

indexingmatrix extraction

Hello,
I have a 7×273 matrix from which I want to extract 39 7×7 matrices to compute a product of matrix exponentials. For example: expm(A1*t)*expm(A2*t)*expm(A3*t)*….*expm(A39*t) where each matrix Ai has a size of 7×7. I can extract them individually but now I'm confused since I need a simultaneous extraction and multiplication. Any suggestions?
Thank you.

Best Answer

% fake input data:
t = 0.3;
A = rand(7,273);
%
C = mat2cell(A,7,7*ones(1,39));
Z = expm(C{1}*t);
for k = 2:39
Z = Z*expm(C{k}*t);
end
Related Question