Why is Q=30 after the loop is ran?
Ältere Kommentare anzeigen
B=1;
Q=0;
if B==1 && Q~=B
Q=20;
if B<0 || Q==20
Q=30;
end
elseif B<10
Q=40;
else
Q=50;
end
disp(Q)
%How do I trace the loop I thought Q would equal 20 after the first condition was met
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements 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!