How to convert cell array to 3D array. I want to convert cell to mat

1 回表示 (過去 30 日間)
Triveni
Triveni 2016 年 1 月 28 日
コメント済み: Triveni 2016 年 1 月 28 日
pu
pu(:,:,1) =
[5x9 double]
pu(:,:,2) =
[4x8 double]
pu(:,:,3) =
[4x7 double]
pu(:,:,4) =
[3x6 double]
du
du(:,:,1) =
[1x9 double]
du(:,:,2) =
[1x8 double]
du(:,:,3) =
[1x7 double]
du(:,:,4) =
[1x6 double]
cell2mat(pu,[],[])
Error using cell2mat
Too many input arguments.
du(:,:,:) = du{:,:,:}
Conversion to cell from double is
not possible.
  3 件のコメント
Triveni
Triveni 2016 年 1 月 28 日
I don't have fixed array size...size is generating randomly. Can i view cell in screen. Instead of [1x8 double] i want to see values??
Andrei Bobrov
Andrei Bobrov 2016 年 1 月 28 日

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2016 年 1 月 28 日
[a,b] = cellfun(@size,pu);
n = numel(pu);
out = zeros(max(a),max(b),n)
for jj = 1:n
out(1:a(jj),1:b(jj),jj) = pu{jj};
end

その他の回答 (0 件)

カテゴリ

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