Skip to Main Content Skip to Search
Product Documentation

switchTarget - Specify target for configuration set

Syntax

switchTarget('config_set', 'sys_tgt_file', target_options)

Description

switchTarget('config_set', 'sys_tgt_file', target_options) specifies a system target file for the configuration set that you specify.

Input Arguments

config_set

Handle to the active configuration set for the model.

sys_tgt_file

String that specifies a system target file.

target_options

Structure of field and value pairs to optionally specify the template makefile, TLC options, make command, and description associated with the target. If you do not want to use any options, you must specify an empty structure ([]).

FieldValue
TemplateMakefileString specifying file name of template makefile.
TLCOptionsString specifying TLC argument.
MakeCommandString specifying make command MATLAB language file.
DescriptionString specifying a description of the target.

Examples

Select an ert.tlc system target file for the active configuration set:

% Get the active configuration set for 'model'
cs = getActiveConfigSet(model);
% Define a system target file
stf = 'ert.tlc';
% Change the system target file for the configuration set.
switchTarget(cs,stf,[]);

Specify an ert.tlc system target file and target options for the active configuration set:

% Get the active configuration set for 'model'
cs = getActiveConfigSet(model);
% Define a system target file
stf = 'ert.tlc';
% Specify target options
tgtOpt.TemplateMakefile = 'grt_default_tmf'; 
tgtOpt.TLCOptions = '-aVarName=1'; 
tgtOpt.MakeCommand = 'make_rtw'; 
tgtOpt.Description = 'my target'; 
% Change the system target file and target options
% for the configuration set.
switchTarget(cs,stf,tgtOpt);

Alternatives

To select system target files using the Configuration Parameters dialog box:

  1. In your model, open the Configuration Parameters dialog box.

  2. Navigate to the Code Generation > General pane.

  3. Specify the System target file.

  4. Optionally specify , Make command, and TLC options.

  5. Click Apply.

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS