MATLAB: Conditional statement in a for/if loop

conditional statementfor loopif statement

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!

Best Answer

Try this:
res = RDSM;
res(LBOS > RBOS) = LDSM(LBOS > RBOS);
T2 = table(frame,res);