how to switch the value of a boolean.
    37 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
Hi, is there any function to do the following :
a = true;
b = someFunction(a)
    ==> b = false
b = sumeFunction(b)
    ==> b = true;
thank you.
0 commentaires
Réponse acceptée
  Honglei Chen
    
      
 le 7 Sep 2012
        
      Modifié(e) : Honglei Chen
    
      
 le 7 Sep 2012
  
      b = ~a;
c = ~b;
or if you are looking for the functional form
b = not(a);
c = not(b);
0 commentaires
Plus de réponses (1)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


