Conditional statement in a for/if loop
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Alex Mcaulley
2019-6-7
Try this:
res = RDSM;
res(LBOS > RBOS) = LDSM(LBOS > RBOS);
T2 = table(frame,res);
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!