The code does not see else condition

7 ビュー (過去 30 日間)
bulent berk ikizoglu
bulent berk ikizoglu 2021 年 6 月 24 日
コメント済み: Onur Hakverdi 2021 年 6 月 24 日
In the code last if statement does not works. In order to title the plot.

採用された回答

Scott MacKenzie
Scott MacKenzie 2021 年 6 月 24 日
編集済み: Scott MacKenzie 2021 年 6 月 24 日
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 件のコメント
Onur Hakverdi
Onur Hakverdi 2021 年 6 月 24 日
320 < wavelength && wavelength < 325 I tried this but It gives error.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by