Using IF to remove upper and lower boundaries
Afficher commentaires plus anciens
Within a FOR loop, I can successfully implement a single IF statement to prevent either the upper or lower values from being manipulated like so:
if (theta1 > 0.7297)
continue
end
However every attempt I have made to remove both upper and lower values has failed. Can anyone explain what is wrong with this:
if (theta1 > 0.7297)
else (theta1 < -0.7297)
continue
end
Thanks.
Réponse acceptée
Plus de réponses (1)
I think this is what you need
if (theta1 > 0.7297 || theta1 < -0.7297)
continue
end
You can enter both conditions in the single If statement.
1 commentaire
Tom
le 29 Oct 2012
Catégories
En savoir plus sur Loops and Conditional Statements 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!