Effacer les filtres
Effacer les filtres

expression that changes if a condition is true

3 vues (au cours des 30 derniers jours)
Valeria Leto
Valeria Leto le 15 Mai 2020
Commenté : Ameer Hamza le 15 Mai 2020
Hi! I know it's a silly question but I don't remember how to write an expression like that
theta=psi+pi*(condition:x<0)
and I want -theta=psi if the condition is false
-theta=psi+pi if the condition is true
thanks!

Réponse acceptée

Ameer Hamza
Ameer Hamza le 15 Mai 2020
This is the correct syntax
theta = psi+pi*(x<0)
  2 commentaires
Valeria Leto
Valeria Leto le 15 Mai 2020
thanks
Ameer Hamza
Ameer Hamza le 15 Mai 2020
I am glad to be of help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by