MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Add Interactive Controls to a Live Script


You can add sliders, drop-downs, check boxes, edit fields, and buttons to your live scripts
to control variable values interactively. Adding interactive controls to a script is useful
when you want to share the script with others. Use interactive controls to set and change
the values of variables in your live script using familiar user interface components.

Insert Controls


To insert a control into a live script, go to the Live Editor tab, and in the Code section,
click Control. Then, select from the available options. To replace an existing value with a
control, select the value and then insert the control. The Control menu only shows
options available for the selected value.

To configure an existing control, right-click the control and select Configure Control.
Press Tab or Enter, or click outside of the control configuration menu to return to the
live script.

Control Description Configuration Details
Numeric Slider Use numeric sliders to
interactively change the value of a
variable by moving the slider
thumb to the desired numeric
value.

The value to the left of the slider is
its current value.

In the Values section, specify a
Min, Max, and Step value.

Add Interactive Controls to a Live Script
Free download pdf