How to convert matrix to cell array?

4 ビュー (過去 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 Center および File ExchangeResizing 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