# How to control Manipulate speed

I want to ask about how can we control Manipulate function so that it is not incrementing the step until the expression is calculated.

I have the following simple code:

data = RandomReal[1, {100, 10}];
data2 = ConstantArray["Emp", {100, 10}];
Manipulate[

data2[[1 + IntegerPart[i/10.00000001], i - IntegerPart[i/10.00000001]*10]] =
data[[1 + IntegerPart[i/10.00000001], i - IntegerPart[i/10.00000001]*10]];

data2 // TableForm, {i, 1, 1000, 1}]


If you see when you click the "PlayButton", the Manipulate jumps the step in non-sequential odder so that it is not calculating the expressions in sequential odder.

I want to ask if there is any way to control the play action of Manipulate so that it is not moving to i + 1 until it is calculated the expressions at i.

-
With default speed it's just not doing steps one by one. You can check with Alt key pressed, then Slider is slower and will update each value. What is the goal at the end? Because I feel like the job you want is not the one for Manipulate. –  Kuba May 1 at 18:38

I'm not sure if it is possible to do what you want in exactly the way you want. The Manipulator runs independently of the updates of the Manipulate body. So its value keeps changing while the Manipulate body is being recalculated. You would need to get the Manipulator to execute FinishDynamic after each update to i. I don't know if that is possible. Probably not.

Here's a workaround:

data = RandomReal[1, {100, 10}];
data2 = ConstantArray["Emp", {100, 10}];
Manipulate[

If[running && i <= 1000, i = i + 1];

data2[[1 + IntegerPart[i/10.00000001], i - IntegerPart[i/10.00000001]*10]] =
data[[1 + IntegerPart[i/10.00000001], i - IntegerPart[i/10.00000001]*10]];
data2 // TableForm,

{i, 1, 1000, 1},
{{running, False}, {True, False}}]


Click on the running check box and it will update data2 one entry at a time.

-
@Kuba AnimationRate -> 1 works as long as each update of the Manipulate body takes less than a second. It would nice if there were a setting such as AnimationRate -> Manipulate and it would wait until the Manipulate has updated. –  Michael E2 May 1 at 21:05
Yes, sorry I've deleted my comment while there were some web glitches, haven't seen your reply :) –  Kuba May 1 at 21:09
@Kuba I've updated my comment to fill in the missing option... :) –  Michael E2 May 1 at 21:10
And yes, this option should be available :) –  Kuba May 1 at 21:11
Thank you guys, it would be great if an option is adde to manipulate function in the coming mathematica 10 so that updating process of the body can be adjusted. but this way works very fine and it help a lot. thank you Kuba and Michael. –  Algohi May 3 at 4:03