我有以下内容:
b = cellfun(@(x) sum(cross(u{1},x)),r,'UniformOutput',false);
我想省略总和并改为:
b = cellfun(@(x) cross(u{1},x),r,'UniformOutput',false);
然而我得到的错误是:
??? Error using ==> reshape
To RESHAPE the number of elements must not change.
Error in ==> cellcross at 4
bres = reshape(bmat,size(grid')); %reshape the get columns of bfield vectors in x y z format
原因是我不认为我在正确的地方总结。我想做总和(交叉(u {1},r {1}))....总和(交叉(u {1},r {n}))但结果似乎没有这样做。< / p>