Find the evaluated condition in decision
1 回表示 (過去 30 日間)
古いコメントを表示
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)
2 件のコメント
回答 (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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!