如何给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!