我得到一個錯誤有:MATLAB:錯誤的subsref
b = cellfun(@(x) nansum(mag.*subsref(cross(u{1},x), struct('type', '()', 'subs', {':',':',3}))),r,'UniformOutput',false);
??? Error using ==> subsref
The "subs" field for the subscript argument to SUBSREF and SUBSASGN must be a cell or character array.
Error in ==> cellcross>@(x)nansum(mag.*subsref(cross(u{1},x),struct('type','()','subs',{':',':',3}))) at 2
b = cellfun(@(x) nansum(mag.*subsref(cross(u{1},x), struct('type', '()', 'subs', {':',':',3}))),r,'UniformOutput',false);
Error in ==> cellcross at 2
b = cellfun(@(x) nansum(mag.*subsref(cross(u{1},x), struct('type', '()', 'subs', {':',':',3}))),r,'UniformOutput',false);
誰能告訴我爲什麼?
我用Matlab 2011年
你能不能給一個最小的工作的例子嗎? – Egon