フィルターのクリア

Extracting square matrices from another matrix

3 ビュー (過去 30 日間)
Fotaras Sitof
Fotaras Sitof 2015 年 11 月 27 日
コメント済み: Fotaras Sitof 2015 年 11 月 27 日
Hello,
I have a 7x273 matrix from which I want to extract 39 7x7 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 7x7. I can extract them individually but now I'm confused since I need a simultaneous extraction and multiplication. Any suggestions?
Thank you.

採用された回答

Stephen23
Stephen23 2015 年 11 月 27 日
編集済み: Stephen23 2015 年 11 月 27 日
% 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
  1 件のコメント
Fotaras Sitof
Fotaras Sitof 2015 年 11 月 27 日
Thanks Stephen. mat2cell works perfect here.

サインインしてコメントする。

その他の回答 (1 件)

Stalin Samuel
Stalin Samuel 2015 年 11 月 27 日
t = 0.2;%for example
tet = rand(7,273);%your matrix
a1 = tet(:,1:7);
n1 = 1;
n2 = 7;
a1 = tet(:,n1:n2);
prdt = ones(size(a1));
for n = 1:38
prdt =prdt*expm(a1*t);%product
n1 = n2+1;
n2 = n2+7;
a1 = tet(:,n1:n2);
end
  1 件のコメント
Fotaras Sitof
Fotaras Sitof 2015 年 11 月 27 日
Cheers buddy.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by