Main Content

uisimdatabutton

Create buttons to save or load simulation data in app

Since R2024a

    Description

    example

    simdatabtn = uisimdatabutton creates a Save Output button in a new figure.

    simdatabtn = uisimdatabutton(style) creates a simulation data button UI component of the style in a new figure. The style can be saveoutput or loadinput

    simdatatbtn = uisimdatabutton(parent) creates a save output UI component in the specified parent container. The parent can be a figure created using the uifigure function or one of its child containers.

    simdatabtn = uisimdatabutton(parent, style) creates a simulation data button UI component of the specified style in the specified parent container. The parent can be a figure created using the uifigure function or one of its child containers. The style can be saveoutput or loadinput.

    simdatabtn = uisimdatabutton(___Name,Value) specifies simulation data button properties using one or more name-value arguments. Use this option with any of the input argument combinations in the previous syntaxes.

    Examples

    collapse all

    Create a save output UI component in a UI figure.

    Set a label for the button.

    fig = uifigure;
    s = uisimdatabutton(fig, Text="Save Output Data");

    Create a load input UI component in a UI figure.

    fig = uifigure;
    s = uisimdatabutton(fig, 'loadinput');

    Create a save output UI component in a UI figure. Then, specify a Simulation object for using the save output button.

    Create a UI figure window containing a panel.

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

    Create a UI simulation data button to save output.

    simOutputButton = uisimdatabutton(panel)

    Specify a simulink.Simulation object to use the simulation output data button with a model.

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

    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.

    Simulation data button style, specified as 'saveoutput' or 'loadinput'. The 'saveoutput' option creates a button to save simulation output data, labeled Save Simulation Output. The 'loadinput' option creates a button to load simulation input data, labeled Load Input.

    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: uisimdatabutton('LoadInput', Text="load my data")

    Note

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

    Filename of button icon, in SVG format, specified as a string scalar or character vector.

    Plot title, specified as a string scalar or character vector.

    Filename that is created on using the Save Output button, specified as a character vector or string scalar. The OutputFileName property is only available with the saveoutput button style.

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

    Version History

    Introduced in R2024a