Cell 2 3d matrix

6 ビュー (過去 30 日間)
Michal
Michal 2013 年 12 月 13 日
コメント済み: Michal 2013 年 12 月 13 日
Hej, I have a cell [1x25] of [256x256 int16] I would like to convert cell into a 3d matrix [256x256x25] (create a stack) but if i using cell2mat I obtain a [256x6400] matrix. Could anyone halp me?

採用された回答

Jos (10584)
Jos (10584) 2013 年 12 月 13 日
Use CAT and comma-separated list expansion:
sz = [2 3] ; % arbitray size
C = {rand(sz), ones(sz), zeros(sz)} % example of your cell data (all elements the same size!)
M = cat(3,C{:}) % concatenate in the 3rd dimension
  1 件のコメント
Michal
Michal 2013 年 12 月 13 日
Thank You;)

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

その他の回答 (1 件)

Simon
Simon 2013 年 12 月 13 日
If C is your cell, try
cat(3, C{:})
  1 件のコメント
Michal
Michal 2013 年 12 月 13 日
Thank You:)

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

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by