Matlab: trasform cell arrays into a matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I want to trasform U (attacched) in a matrix Z 5 x 12
Z=[0 0 0 0 0 0 0 0 0 0 1933724 260957; 341255 0 0 0 0 0 0 0 0 0 16907 0; 23261 0 0 0 0 0 0 153505 0 420315 0 15372; 0 0 0 0 0 0 0 0 0 5535878 0 0; 0 0 0 0 0 0 0 0 0 16516 0 316637]
Can you help me? Thanks
0 件のコメント
採用された回答
Andrei Bobrov
2016 年 9 月 7 日
編集済み: Andrei Bobrov
2016 年 9 月 7 日
zz = cat(1,U{:});
zz(cellfun(@isempty,zz)) = {0};
Z = cellfun(@(x)x(1),zz);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!