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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by