Hi all,
I have a cell like this
K>> respColrespCol = 1×24 cell array Columns 1 through 5 {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} Columns 6 through 10 {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} Columns 11 through 15 {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} Columns 16 through 20 {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell} Columns 21 through 24 {3×1 cell} {3×1 cell} {3×1 cell} {3×1 cell}
and each cell contains
K>> respCol{1}ans = 3×1 cell array [1034×2 double] [ 2×2 double] [ 6×2 double]
Now I'd like to make the arrays in each cell negative using cellfun, I tried this but didn't work
K>> cellfun(@(v) -v, respCol, 'un', 0)Undefined unary operator '-' for input arguments of type 'cell'.Error in beam>@(v)-v
So how can I do it?
Many thanks!
Best Answer