Hi, I have a matrix of 24 x 10 and would like to convert it into 4 x 6 x 10. The first column of the 'test.mat' will form 4 x 6, etc. I have tried the following code from :https://www.mathworks.com/matlabcentral/answers/137535-converting-2d-matrix-to-3d but I cant seems to get the result. Thank you for the help.
test1 = permute(reshape(test,4,10,6),[1 3 2]);

 채택된 답변

Stephen23
Stephen23 2020년 7월 27일
편집: Stephen23 2020년 7월 27일

0 개 추천

Depending on how you want them arranged in the new array, either
test1 = reshape(test,4,6,10);
or
test1 = permute(reshape(test,6,4,10),[2,1,3]);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

질문:

2020년 7월 27일

편집:

2020년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by