How to convert cell arrays inside a cell to matrix?

2 ビュー (過去 30 日間)
Abhishek Baba
Abhishek Baba 2020 年 11 月 30 日
コメント済み: Abhishek Baba 2020 年 11 月 30 日
I have a cell which contains another cell which contains another cell in it. I want to convert the most inside cell to matrix but using cell2mat is not working as it is saying "CELL2MAT does not support cell arrays containing cell arrays or objects."
Any other function or some idea how to convert inner cell arrays to matrix?
Thank you.
  1 件のコメント
VBBV
VBBV 2020 年 11 月 30 日
Try nested cell2mat

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 30 日
編集済み: Ameer Hamza 2020 年 11 月 30 日
The exact solution depends on how the data is structured inside the nested cell arrays. The following code shows an example
C = {{{[1 2 3]}}, {{[4 5 6]}}, {{[7 8 9]}}};
C1 = [C{:}];
C2 = [C1{:}];
C3 = [C2{:}];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by