6
$\begingroup$

I want to use a slider (not drop-down list) for a list of discreteValues to do the Manipulate (I used Sin[x] below for simplicity, but the actual one is much more complicated). At the same time, I needed to show a function of x next to the slider (below I used x^2 as an example).

Besides, since the output would be used by other notebook, I would use SaveDefinitions -> True.

discreteValues = {0, 0.2, 0.4, 0.8, 1.6, 2.0, 2.2};

Manipulate[Sin[x],Row[{Control[{x, discreteValues, Manipulator, AutoAction -> False}], Dynamic[x^2]}], SaveDefinitions -> True]

By default, the slider won't auto-run. How can I force the slider to auto-run by default?

I tried to simply change Manipulate to Animate, but I got the error.

Many thanks!

$\endgroup$
6
$\begingroup$

Replace Manipulator with Animator:

Manipulate[Sin[x], 
 Row[{Control[{x, discreteValues, Animator}], Dynamic[x^2]}], 
 SaveDefinitions -> True]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.