Find the evaluated condition in decision
古いコメントを表示
Can someone help me with a program to find the condition of a decision which is executed. For example
((u == 1)&&(u1==2))||(u ==2)&&u1==2)
In this decision the if the 1st condition is satisfied the second condition is not evaluated (short circuited)
回答 (1 件)
Image Analyst
2020 年 5 月 25 日
Do you mean like this?
if (u == 1) && (u1==2)
% First condition code.
elseif (u == 2) && u1 == 2 % Only evaluated if the first test fails.
end
3 件のコメント
Ajay krishna Vasanthakumar
2020 年 5 月 25 日
Ajay krishna Vasanthakumar
2020 年 5 月 25 日
Ajay krishna Vasanthakumar
2020 年 5 月 25 日
カテゴリ
ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!