How do i set a cut off point for for loops?
2 次查看(过去 30 天)
显示 更早的评论
I am working on a structural analysis problem for a beam with two loads and need to plots deflections based off the loads. I have two for loops set up so the loads can vary and need to end the for loops when the deflection is 1/100 of the beams length (L/100).
0 个评论
回答(1 个)
Audrey
2015-2-6
You can use the command "break" to exit out of a for loop. So, something like:
for ii=1:x
...
if deflection>L/100
break;
end
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!