如何给Cell中的每个元素reshape(不想用for)。
古いコメントを表示
由于我要用eig函数,所以以前数据结构中cell的每个元素是1X9的矩阵,必须reshape成3X3的矩阵,然后使用cellfun就安逸了。
使用for循环,肯定可以。但是由于数据很多,大概10w+个,效率很低。不知道cellfun能支持reshape函数么?
有经验的大大,求助啊!
现在的解决方案是:
for i=1:ngp
gp_C_cell{i,1} = reshape(gp_C_cell{i,1},3,3)';
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で 结构体 についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!