Converting 2D cell array to 3D matrix
조회 수: 26 (최근 30일)
이전 댓글 표시
I have a cell that is [8x454] with each element in the cell containing a [900x1] matrix. I would like to convert this cell into a 3 dimensional matrix of size [8x454x900]. Ive tried some things including reshape, cat and permute but can never seem to get it right. Any help would be greatly appreciated!
댓글 수: 0
채택된 답변
James Tursa
2023년 6월 10일
편집: James Tursa
2023년 6월 10일
E.g.,
MyCell = repmat({(1:4)'},2,3) % small sample data
[m,n] = size(MyCell);
reshape(cell2mat(MyCell(:)').',m,n,[])
size(ans)
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!