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개)

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 CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by