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.

 Réponse acceptée

Simon Chan
Simon Chan le 20 Août 2021

0 votes

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

Plus de réponses (1)

Chunru
Chunru le 20 Août 2021

0 votes

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

3 commentaires

Lilya
Lilya le 20 Août 2021
Modifié(e) : Lilya le 20 Août 2021
Thanks for the answer
The matrix is zeros. I cant have the data
Chunru
Chunru le 21 Août 2021
Are you sure?
Lilya
Lilya le 21 Août 2021
Yes

Connectez-vous pour commenter.

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by