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

질문:

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