Conditional statement in a for/if loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Fraje Watson
am 6 Jun. 2019
Kommentiert: Fraje Watson
am 7 Jun. 2019
Hi,
I'm trying to write a loop with 5 variables. Here's what I want to do in words, but can't make my code work
for every value of Frame
if LBOS > RBOS
give LDSM
else give RDSM
I'd like the results to be displayed in a table alongside the associated Frame value. I hope that makes sense.
Thanks very much!
1 Kommentar
Akzeptierte Antwort
Alex Mcaulley
am 7 Jun. 2019
Try this:
res = RDSM;
res(LBOS > RBOS) = LDSM(LBOS > RBOS);
T2 = table(frame,res);
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!