Main Content

slConfigUISetVal

Set value for any model configuration parameter

Description

example

slConfigUISetVal(hDlg,hSrc,'OptionName',value) is used in the context of a user-written SelectCallback function, which is triggered when the custom target is selected in the System Target File Browser in the Configuration Parameters dialog box. You use slConfigUISetVal to set the value of a specified target option.

Examples

collapse all

The slConfigUISetVal function sets the value 'off' for the Configuration Parameters > Code Generation > Interface > Advanced parameters > Terminate function required option.

function usertarget_selectcallback(hDlg,hSrc)

  disp(['*** Select callback triggered:',sprintf('\n'), ...
        '  Uncheck and disable "Terminate function required".']);

  disp(['Value of IncludeMdlTerminateFcn was ', ...
        slConfigUIGetVal(hDlg,hSrc,'IncludeMdlTerminateFcn')]);

  slConfigUISetVal(hDlg,hSrc,'IncludeMdlTerminateFcn','off');
  slConfigUISetEnabled(hDlg,hSrc,'IncludeMdlTerminateFcn',false);
  hSrc.refreshDialog;

Input Arguments

collapse all

Handle created in the context of a SelectCallback function and used by the System Target File Callback Interface functions. Pass this variable but do not set it or use it for another purpose.

Example: hDlg

Handle created in the context of a SelectCallback function and used by the System Target File Callback Interface functions. Pass this variable and use it to refresh the Configuration Parameters dialog box. Do not set it or use it for another purpose.

Example: hSrc

Quoted name and value of the TLC variable defined for a model configuration parameter.

Example: 'myConfigVariable',1

Introduced in R2006b