フィルターのクリア

Converting cell to 3 dimensional matrix

76 ビュー (過去 30 日間)
Pankaj
Pankaj 2017 年 2 月 25 日
コメント済み: Stephen23 2023 年 3 月 22 日
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 日
If C is your cell array:
cell2mat(permute(C,[1,3,2]))
or
cell2mat(reshape(C,1,1,[]))
or
cat(3,C{:})
  2 件のコメント
Giovanni Bambini
Giovanni Bambini 2023 年 3 月 22 日
And what if I want a50x11x2?
Stephen23
Stephen23 2023 年 3 月 22 日
"And what if I want a50x11x2?"
permute(cat(3,C{:}),[3,1,2])

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by