How do i set a cut off point for for loops?

2 ビュー (過去 30 日間)
Michael F
Michael F 2015 年 2 月 5 日
回答済み: Audrey 2015 年 2 月 6 日
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).

回答 (1 件)

Audrey
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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by