I was looking at on Matlab code , I could not understand the use of tilde ~ before if condition .
if ~isfield(ArgDS,'mu')

 Réponse acceptée

Star Strider
Star Strider le 12 Nov 2016

5 votes

The tilde ‘~’ is a logical negation. So the if condition will be true when 'mu' is not a field of the ‘ArgDS’ structure.

2 commentaires

boureghda mohammed
boureghda mohammed le 14 Nov 2016
Thanks for the clarification "Star Strider"
Star Strider
Star Strider le 14 Nov 2016
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by