如何给Cell中的每个元素reshape(不想用for)。
Show older comments
由于我要用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
Accepted Answer
More Answers (0)
Categories
Find more on 结构体 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!