plz. help me TT I want write if(((mp(1)>0)&(mp(1)<140))&((mp(2)>0)&(mp(2)<140)))
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
0<mp(1)<140 + 0<mp(2)<140
that write to if(here)
plz TT
if(((mp(1)>0)&(mp(1)<140))&((mp(2)>0)&(mp(2)<140)))
thats incorrect T.T
1 commentaire
Guillaume
le 21 Oct 2015
Modifié(e) : Guillaume
le 21 Oct 2015
What does the '+' mean in your 0<mp(1)<140 + 0<mp(2)<140 expression? While you can add logical expression, I'm fairly certain that's not what you mean.
Your code would be a lot more readable if there wasn't so many unnecessary brackets.
if mp(1) > 0 && mp(1) < 140 && mp(2) > 0 && mp(2) < 140
is exactly the same as you've written but a lot more readable.
Finally, you'll have to explain what 'that's incorrect' means.
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!