How to convert matrix to cell array?

조회 수: 13 (최근 30일)
SRI
SRI 2019년 8월 11일
편집: SRI 2019년 8월 11일
I have 4*140 double matrix ,and now i want to convert this matrix into 1*35 cell array,in that each cell contains 4*4 double cell

채택된 답변

Bruno Luong
Bruno Luong 2019년 8월 11일
편집: Bruno Luong 2019년 8월 11일
c = mat2cell(A,4,4*ones(1,35))
If you want nested cell as well, do that after the above
c = cellfun(@num2cell, c, 'unif', 0)
Be aware, cell is innefficient to work with.
  댓글 수: 1
SRI
SRI 2019년 8월 11일
편집: SRI 2019년 8월 11일
c = mat2cell(A,4,4*ones(1,35)) % this command line works me sir
c = cellfun(@num2cell, c, 'unif', 0) % wow ,i understand very clearly this command line
Thanks a lot sir ,we done a great job to me.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by