Hello everyone.How to modify the judgment code below and add'This is correct' and'This is wrong'?

조회 수: 1 (최근 30일)
lamda1=4;
v=('This is correct');Ak = ('This is wrong');
if 0.125<lamda1<3
lamda1=v;
else
lamda1 =Ak;
end
  댓글 수: 1
Abhishek Gupta
Abhishek Gupta 2020년 12월 21일
Hi,
Can you please elaborate your question? I see that you are updating the value of 'lamda1' based on its original value. But, what is it that you would like to achieve finally?

댓글을 달려면 로그인하십시오.

답변 (1개)

Rik
Rik 2020년 12월 21일
As mlint is already warning you: 0.125<lamda1<3 is not doing what you think it does. Use this instead:
if 0.125<lamda1 && lambda1<3

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by