Converting cell to 3 dimensional matrix

I have a cell of size [1, 50] each of it is 11 x 2 matrix.
I would like it to convert it to a 3-d matrix of size 11 X 2 X 50.
How it can be done? Cane it be done using reshape?
Thanks

 채택된 답변

Stephen23
Stephen23 2017년 2월 25일
편집: Stephen23 2017년 2월 25일

5 개 추천

If C is your cell array:
cell2mat(permute(C,[1,3,2]))
or
cell2mat(reshape(C,1,1,[]))
or
cat(3,C{:})

댓글 수: 2

And what if I want a50x11x2?
"And what if I want a50x11x2?"
permute(cat(3,C{:}),[3,1,2])

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2017년 2월 25일

댓글:

2023년 3월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by