How to convert matrix to cell array?

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

 采纳的回答

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 个)

类别

帮助中心File 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