Find the evaluated condition in decision
Ältere Kommentare anzeigen
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 Kommentare
Rik
am 25 Mai 2020
What should be the output?
Ajay krishna Vasanthakumar
am 25 Mai 2020
Antworten (1)
Image Analyst
am 25 Mai 2020
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 Kommentare
Ajay krishna Vasanthakumar
am 25 Mai 2020
Ajay krishna Vasanthakumar
am 25 Mai 2020
Ajay krishna Vasanthakumar
am 25 Mai 2020
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!