Effacer les filtres
Effacer les filtres

How to change sign in a cell?

2 vues (au cours des 30 derniers jours)
Xh Du
Xh Du le 9 Jan 2017
Commenté : Xh Du le 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!

Réponse acceptée

James Tursa
James Tursa le 9 Jan 2017
Modifié(e) : James Tursa le 9 Jan 2017
respPreStore = cellfun(@uminus,respPreStore,'uni',false);
  1 commentaire
Xh Du
Xh Du le 10 Jan 2017
Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by