How to extract matrix from cell?

10 ビュー (過去 30 日間)
Lilya
Lilya 2021 年 8 月 20 日
コメント済み: Lilya 2021 年 8 月 21 日
Hi all,
I have a bunch of matrices in the cell array (1*365). Each of these matrices has a dimension of (21*41*24). I have to extract the matrices from 32 to 59 and store them in one double array.
by using the following code, I got the last matrix
for i = 32:59;
iwant = myCell{i} ;
end
Any help is appreciated.

採用された回答

Simon Chan
Simon Chan 2021 年 8 月 20 日
Try this:
iwant=cat(4,myCell{32:59});
  1 件のコメント
Lilya
Lilya 2021 年 8 月 21 日
Thank you!!

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

その他の回答 (1 件)

Chunru
Chunru 2021 年 8 月 20 日
iwant = zeros(21, 41, 24, 28); % 32->59: 28
for i = 32:59;
iwant(:, :, :, i) = myCell{i} ;
end
  3 件のコメント
Chunru
Chunru 2021 年 8 月 21 日
Are you sure?
Lilya
Lilya 2021 年 8 月 21 日
Yes

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

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by