Clear Filters
Clear Filters

How to change sign in a cell?

2 views (last 30 days)
Xh Du
Xh Du on 9 Jan 2017
Commented: Xh Du on 10 Jan 2017
Hi all:
I have a cell 'respPreStore' like this:
size(respPreStore)
ans =
1 2 5 2
each cell element is
respPreStore(:,:,1,1) =
[12x4 double] [12x4 double]
Now I simply want to change sign of each value in respPreStore, however if I do:
-respPreStore
Undefined function 'uminus' for input arguments of type 'cell'.
How can I change sign of each value in respPreStore?
Many thanks!

Accepted Answer

James Tursa
James Tursa on 9 Jan 2017
Edited: James Tursa on 9 Jan 2017
respPreStore = cellfun(@uminus,respPreStore,'uni',false);

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!