How to extract matrix from cell?

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 日

0 投票

Try this:
iwant=cat(4,myCell{32:59});

その他の回答 (1 件)

Chunru
Chunru 2021 年 8 月 20 日

0 投票

iwant = zeros(21, 41, 24, 28); % 32->59: 28
for i = 32:59;
iwant(:, :, :, i) = myCell{i} ;
end

3 件のコメント

Lilya
Lilya 2021 年 8 月 20 日
編集済み: Lilya 2021 年 8 月 20 日
Thanks for the answer
The matrix is zeros. I cant have the data
Chunru
Chunru 2021 年 8 月 21 日
Are you sure?
Lilya
Lilya 2021 年 8 月 21 日
Yes

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

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2021 年 8 月 20 日

コメント済み:

2021 年 8 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by