Main Content

setDefaultParamSet

Set default parameter set on target computer

Since R2024a

Description

setDefaultParamSet(target_object,app_name,parameter_set_name) sets parameter_set_name as the default parameter set for the application app_name on the target computer target_object. When you load the application, Simulink® Real-Time™ loads the selected default parameter set. For more information about using the parameter set workflow, see Save and Reload Parameters by Using the MATLAB Language.

Note

The default parameter set and startup parameter set are different names for the same parameter set that Simulink Real-Time loads when loading the real-time application. The different names denote different workflows for selecting the default or startup parameter sets and the location where the parameter set is stored.

  • By using the setDefaultParameSet function, you set the default parameter set selection in the real-time application MLDATX file on the target computer.

  • By using the updateStartupParameterSet function, you set the startup parameter set selection in the real-time application MLDATX file on the development computer.

example

Examples

collapse all

This example creates a target object tg representing the target computer, connects MATLAB to the target computer, and set the specified parameter set as the default parameter set.

% connect to target computer; open model; build app;
tg = slrealtime;
mdlSTF = getSTFName(tg);
mdlName = 'slrt_ex_osc_outport';
openExample(mdlName);
set_param(mdlName,"SystemTargetFile",mdlSTF);
slbuild(mdlName);

% load app; save param set;
load(tg,mdlName);
paramSetName = 'outportTypes';
saveParamSet(tg,paramSetName);

% select default param set in app MLDATX file on target computer
setDefaultParamSet(tg,mdlName,paramSetName);

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Parameter set name, specified as a character vector or string scalar. Sets the specified parameter set as the default option for the application.

Example: 'slrt_paramset_default'

Provides name of real-time application MLDATX file that you built from the model.

Example: 'slrt_ex_osc'

Version History

Introduced in R2024a