Main Content

uisimcontrols

Create simulation controls in app

Since R2024a

    Description

    scntrl = uisimcontrols creates simulation controls UI components in a new figure.

    scntrl = uisimcontrols(parent) creates simulation control buttons UI components in the specified parent container.

    scntrl = uisimcontrols(___,Name,Value) specifies simulation control button properties using one or more name-value arguments. Use this option with any of the input argument combinations in the previous syntaxes.

    example

    Examples

    collapse all

    Create a simulation controls UI component in a panel.

    fig = uifigure('Name','myFigure');
    panel = uipanel(fig)
    simControl = uisimcontrols(panel)

    Create a simulation control UI component in a UI figure, and then specify a Simulation object for the simulation controls.

    Create a UI figure window containing simulation controls and a panel.

    fig = uifigure('Name','myFigure');
    panel = uipanel(fig)
    simCntrl = uisimcontrols(panel)

    Specify a Simulation object to use the simulation controls buttons with a model.

    runSim = simulation('mdlName')
    simCntrl.Simulation = runSim;

    Now, you can use the simulation controls button to control the model simulation.

    Input Arguments

    collapse all

    Parent container, specified as a Figure object created using the uifigure function or one of its child containers, such as a Tab, Panel, or GridLayout object. If you do not specify a parent container, MATLAB® calls the uifigure function to create a new Figure object that serves as the parent container.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: uisimcontrols(StartText="Start Sim")

    Note

    The properties listed here are a subset of the available properties. For the full list, see SimulationControls Properties.

    Start button label, specified as a character vector, cell array of character vectors, string scalar, string array, or 1-D categorical array. Specify a character vector or string scalar to label the button with a single line of text. Use a cell array or string array to label the button with multiple lines of text. Each element in the array represents a separate line of text. If you specify this property as a categorical array, MATLAB uses the values in the array, not the full set of categories

    Example: uisimcontrols('StartText','Start Sim')

    Pause button label, specified as a character vector, cell array of character vectors, string scalar, string array, or 1-D categorical array. Specify a character vector or string scalar to label the button with a single line of text. Use a cell array or string array to label the button with multiple lines of text. Each element in the array represents a separate line of text. If you specify this property as a categorical array, MATLAB uses the values in the array, not the full set of categories

    Example: uisimcontrols('PauseText','Pause Sim')

    Continue button label, specified as a character vector, cell array of character vectors, string scalar, string array, or 1-D categorical array. Specify a character vector or string scalar to label the button with a single line of text. Use a cell array or string array to label the button with multiple lines of text. Each element in the array represents a separate line of text. If you specify this property as a categorical array, MATLAB uses the values in the array, not the full set of categories

    Example: uisimcontrols('ContinueText','Cont.')

    Stop button label,, specified as a character vector, cell array of character vectors, string scalar, string array, or 1-D categorical array. Specify a character vector or string scalar to label the button with a single line of text. Use a cell array or string array to label the button with multiple lines of text. Each element in the array represents a separate line of text. If you specify this property as a categorical array, MATLAB uses the values in the array, not the full set of categories

    Example: uisimcontrols('StopText','Stop Sim')

    Simulation representation that provides an interface to control the simulation of a Simulink® model, specified as a Simulation object.

    Version History

    Introduced in R2024a