How to convert 32x32x2x20000 into 20000x1 cell array?

조회 수: 1 (최근 30일)
KAI-YANG WANG
KAI-YANG WANG 2021년 9월 3일
답변: Matt J 2021년 9월 5일
How to convert 32x32x2x20000 into 20000x1 cell array, I got a data from the output of a cnn network and i would llike to convert the 32x32x2x20000 into 20000x1 cell array and in each cell has the 32x32x2 data. Deos anyone can help, Thank you !

채택된 답변

per isakson
per isakson 2021년 9월 5일
편집: per isakson 2021년 9월 5일
A mat2cell example
%%
M = ones(32,32,2,6); % Sample data (20000 replaced by 6)
C = mat2cell( M, 32, 32, 2, ones(1,6) );
%%
C = squeeze( C );
C
C = 6×1 cell array
{32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double}

추가 답변 (2개)

Fangjun Jiang
Fangjun Jiang 2021년 9월 3일
mat2cell() ?

Matt J
Matt J 2021년 9월 5일
A = rand(32,32,2,20);
C=num2cell(A,[1,2,3]);
C=C(:)
C = 20×1 cell array
{32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double} {32×32×2 double}

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by