フィルターのクリア

loop for 3d matrix to numerous 2d matrices

1 回表示 (過去 30 日間)
john
john 2013 年 1 月 22 日
I have a 3d matrix which is too large to be viewed in the variable editor as it is (134,68,243). And need to put the data into 68 readable 2d matrices. I have done some the labourious way but i was wondering if there was a quicker way to do it
a1 = a(:,1,:); a2 = a(:,2,:); a3 = a(:,3,:); a4 = a(:,4,:); a5 = a(:,5,:); ...

回答 (2 件)

José-Luis
José-Luis 2013 年 1 月 22 日
You could try using a cell array instead:
your_mat = rand(10,20,30);
[m n o] = size(your_mat);
your_mat = squeeze(mat2cell(your_mat,m,n,ones(1,o)));

Matt J
Matt J 2013 年 1 月 22 日
編集済み: Matt J 2013 年 1 月 22 日
C=num2cell(permute(a,[1,3,2]),[1,2]);

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by