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