qc_get_model_arguments qc_get_model_copy navigation bar

Table of Contents

qc_set_model_arguments

Sets the model arguments in the MEX-file arguments.

Syntax

qc_set_model_arguments(model, arguments)       % Sets model arguments of specified model
qc_set_model_arguments(config_set, arguments)  % Sets model arguments of specified configuration set
qc_set_model_arguments(arguments)              % Sets model arguments of current model
    

Description

Sets the model arguments of a model to arguments. If no model is specified, then the current model is used. Each configuration of the model may have its own model arguments.

The following format specifiers are recognized and replaced with the appropriate values when the model arguments are used.

Format Specifier

Description

%d

the current Matlab directory in quotes e.g. "C:\Documents and Settings\myname\My Documents\MATLAB"

%D

the current Matlab directory using short filenames (PC) or escaped spaces (UNIX) e.g. "C:\Docume~1\myname\MyDocu~1\MATLAB" (requires Simulink Coder)

%m

the model name e.g. mymodel

%u

the model URI e.g. tcpip://localhost:17001?nagle='no'

%s

the scheme from the model URI e.g. tcpip

%h

the hostname from the model URI e.g. localhost

%p

the port from the model URI (not usually used) e.g. 17001

%P

the path from the model URI i.e. the portion following the '/' after the hostname and port (not usually used)

%a

the authority from the model URI and any path separator e.g. '//hostname:port/', if present

%o

the options from the model URI i.e. the portion following the '?' after the path (not usually used)

%f

the fragment from the model URI i.e. the portion following the '#' (not usually used)

%q

replaced with a double quote (since MATLAB does not accept double quote characters)

%t

the target type for the given model or configuration set (e.g. windows, qnx_x86, etc.)

%(var)

the value of environment variable 'var' (on the host!) e.g. %(PATH)

%{expr}

the value of a MATLAB expression e.g. %{x + 1}

The current MATLAB directory specifiers, %d or %D, are particularly useful in the model arguments, where %d is employed by default to set the current working directory of the model.

The model name and specifiers revolving around the model URI are generally used when specifying the target URI, since the model URI and the target URI should refer to the same target machine. See qc_set_default_target_uri for details.

The environment variable specifier is convenient for accessing the user's home directory, for example, by using the format specifier %(HOME).

The ability to substitute a MATLAB expression is useful in many instances. For example, the filename parameter of the To Host File allows format specifiers to be used so that the date and/or time may be embedded in the filename of the data file. Some particularly useful expressions are:

Expression

Description

%{date}

the current date. See

date

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

doc date
.

%{time}

the current time. See time.

%{datestr(now,format)}

the date or time in a particular format. See

datestr

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

doc datestr
for valid formats.

%{instance(3)}

an instance count, incremented every time the substitution is performed. See instance.

%{qc_get_step_size}

the step size (sampling period) of the model in seconds

%{1/qc_get_step_size}

the sampling frequency of the model in Hz

%{Kp}

the value of MATLAB variable, Kp

Parameters

model

A string containing the name of a model. The model is used to determine the active configuration in which to set the model arguments.

config_set

A Simulink.ConfigSet configuration set (see

getConfigSet

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

doc getConfigSet
). The configuration set contains the copy filename and is used for format specifier substitutions.

arguments

A string containing the new model arguments e.g. '-w -d /tmp -uri %d'

Outputs

This function has no outputs.

Examples

qc_set_model_arguments('q_a_lpbk', '-w -d /tmp -uri %u'); % Sets arguments of q_a_lpbk model to '-w -d /tmp -uri %u'.
    

See Also

 

navigation bar