How can I pause play in Manipulate when a condition is met ? Here is an example:
Manipulate[
Plot[i*Sin[x], {x, 0, 10}, PlotRange -> 10], {i, 1, 10,
AnimationRate -> 3, RefreshRate -> 60, Appearance -> "Open"}]
When I press the "Play" Buttom, i
increases.
Now, I want the animation to stop automatically, when i
reaches a certain value, say i=5
.
How can I do that ?
EDIT: Thanks a lot for the great answers. Would it be possible to implement the following:
One can define points for which play will stop, for instance, at i=2, i=4, and i=8
When i== One of the points -> Then play will stop, if I press the play buttom again, then it will continue to run until the next break point:
Example:
i==2 -> Stop
Manually: Press Play --> Continues
i==4 -> Stop
Manually: Press Play --> Continues
etc.