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

3 views (last 30 days)
Michael F
Michael F on 5 Feb 2015
Answered: Audrey on 6 Feb 2015
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).

Answers (1)

Audrey
Audrey on 6 Feb 2015
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

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!