Define a Slider by Formula

Top  Previous  Next

How To... > Work with Dynamic Parameters (Sliders) > Define a Slider by Formula

Why would you want to have a slider with a formula?

You need to know the square root of 5. Use a slider as a “scratch” calculator.

You want to calculate a value from a collection and allow other collections to use it.

You want theparameter to a model or simulation to be chosen randomly from a certain distribution.

You are creating a simulation in which you need a parameter to evolve recursively over time.

To define a slider by formula:

sliderbyformula

 

1.With the slider selected, choose Edit | Edit Formula to show a formula editor.
2.Enter a formula. Here’s a fun one: randomInteger(1,6).
3.Close the formula editor and press the animation button on the slider.

The value of the slider will update each time you click the animation button. Notice that the slider’s thumb has changed shape and is no longer draggable. Notice also that the value of the slider is gray to remind you that it is computed.

You can edit a computed slider’s formula. Editing a slider value wipes out its formula; the text becomes blue and the draggable thumb returns.

See the sample document Slider Examples.ftm for uses of the new slider functionality.

See also

Slider Properties Panel

Work with the Formula Editor