IF condition with interval
조회 수: 292 (최근 30일)
이전 댓글 표시
I want to have a script that runs if the variable X is within 0 and 1. I writed down the following code:
if 0 < X < 1
statement
else display(NaN)
end
The output script isn't an error but the if condition is not respected and values are away from the interval.
How can I solve this problem. Thanks in advance.
댓글 수: 0
채택된 답변
the cyclist
2014년 8월 25일
편집: the cyclist
2014년 8월 25일
You have to write it as two sub-conditions:
if (0<X) && (X<1)
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!