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.

 Respuesta aceptada

Simon Chan
Simon Chan el 20 de Ag. de 2021
Try this:
iwant=cat(4,myCell{32:59});

Más respuestas (1)

Chunru
Chunru el 20 de Ag. de 2021
iwant = zeros(21, 41, 24, 28); % 32->59: 28
for i = 32:59;
iwant(:, :, :, i) = myCell{i} ;
end

3 comentarios

Lilya
Lilya el 20 de Ag. de 2021
Editada: Lilya el 20 de Ag. de 2021
Thanks for the answer
The matrix is zeros. I cant have the data
Chunru
Chunru el 21 de Ag. de 2021
Are you sure?
Lilya
Lilya el 21 de Ag. de 2021
Yes

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Ag. de 2021

Comentada:

el 21 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by