The code does not see else condition

8 vues (au cours des 30 derniers jours)
bulent berk ikizoglu
bulent berk ikizoglu le 24 Juin 2021
Commenté : Onur Hakverdi le 24 Juin 2021
In the code last if statement does not works. In order to title the plot.

Réponse acceptée

Scott MacKenzie
Scott MacKenzie le 24 Juin 2021
Modifié(e) : Scott MacKenzie le 24 Juin 2021
You've got an error in how you setup the if-expressions. For example, you need to change the first if-expression from
320 < wavelength < 325
to
320 < wavelength && wavelength < 325
Change the others in a similar manner, and try again.
To explain, note that
320 < wavelength < 325
is syntactically correct, but is the same as
(320 < wavelength) < 325
and reduces to either
0 < 325
or
1 < 325
I doubt this is what you intended.
  1 commentaire
Onur Hakverdi
Onur Hakverdi le 24 Juin 2021
320 < wavelength && wavelength < 325 I tried this but It gives error.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by