Main Content


Create load real-time application button for instrument panel UI

Since R2021b



hLoadButton = slrealtime.ui.control.LoadButton(hFigure) creates a target computer load button for an instrument panel uifigure figure. This button loads a real-time application onto the target computer and optionally displays the currently loaded application. You can disable this display by using a button property. The button has properties that enable you to set a loading option for skip install and asynchronous load.

For information about control properties, see slrealtime.ui Properties. If deploying an app, it is important to set the TargetSource property for this control.


The LoadButton operates differently when used in a compiled (standalone) instrument panel app. Instead of opening the load file UI, pressing the Load button loads the MLDATX file that is selected from the Application property for the LoadButton. You include this MLDATX file in the compiled and packaged app. In the app, select the real-time application by adding code that sets the MLDATX file name. This example code selects the slrt_ex_osc MLDATX file.

% Define the real-time application file to load.
app.LoadButton.Application = 'slrt_ex_osc';

For more information, see Create Standalone Instrument Panel App by Using Application Compiler.


collapse all

Create a real-time application load button and adjust the position of the button.

% Create figure
hFig = uifigure();
% Create load application component
hLoaded = slrealtime.ui.control.LoadButton(hFig);
% Change position of the component
hLoaded.Position = [0 0 200 200];
% Associate with a Target Select component
hLoaded.TargetSource = 'TargetPC1';
% Customize
hLoaded.LoadIcon = fullfile(pwd, 'myLoadIcon.png');
hLoaded.LoadText = 'push to load'; 

Input Arguments

collapse all

The hFigure argument identifies the uifigure to which you are adding the UI component.

Example: hFig = uifigure()

Data Types: function_handle

Output Arguments

collapse all

The hLoadButton argument is the handle to the load button component that you create.

Version History

Introduced in R2021b

expand all