IF condition with interval
249 ビュー (過去 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!