Writing S-Functions |
 |
ssWriteRTWParamSettings
Write tunable parameter settings to model.rtw
file.
Syntax
int_T ssWriteRTWParamSettings(SimStruct *S, int_T nParamSettings,
int_T paramType, const char_T *settingName, ...)
Arguments
S
SimStruct representing an S-function block.
nParamSettings
Number of tunable parameter settings
settingType
Type of parameter (see Parameter Setting Type-Specific Arguments)
settingName
Name of parameter setting
...
Remaining arguments depend on parameter type (see Parameter Setting Type-Specific Arguments).
Description
Use this function in mdlRTW
to write tunable parameter setting information to this S-function's model.rtw
file. This function returns TRUE
if successful.
Parameter Setting Type-Specific Arguments
This section lists the parameter-specific arguments required by each parameter type.
SSWRITE_VALUE_STR (
unquoted string
Argument
|
Description
|
const char_T *value
|
string (Example: U.S.A. )
|
)
SSWRITE_VALUE_QSTR (
quoted string)
Argument
|
Description
|
const char_T *value
|
string (Example: "U.S.A." )
|
SSWRITE_VALUE_VECT_STR
(vector of strings)
Argument
|
Description
|
const char_T *value
|
Vector of strings (e.g., ["USA", "Mexico"] )
|
int_T nItemsInVect
|
Size of vector
|
SSWRITE_VALUE_NUM
Argument
|
Description
|
const real_T value
|
Number (e.g., 2)
|
(number)
-
SSWRITE_VALUE_VECT
(vector of numbers)
Argument
|
Description
|
const real_T *value
|
Vector of numbers (e.g., [300, 100] )
|
int_T vectLen
|
Size of vector
|
-
SSWRITE_VALUE_2DMAT
(matrix of numbers)
Argument
|
Description
|
const real_T *value
|
Matrix of numbers (e.g.,
[[170, 130],[60, 40]] )
|
int_T nRows
|
Number of rows in vector
|
int_T nCols
|
Number of columns in vector
|
-
SSWRITE_VALUE_DTYPE_NUM
(data typed number)
-
SSWRITE_VALUE_DTYPE_VECT
(data typed vector)
Argument
|
Description
|
const void *value
|
Data typed vector (e.g., [ 1+2i, 3+4i])
|
int_T vectLen
|
Size of vector
|
int_T dtInfo
|
Data type (see Specifying Data Type Info)
|
-
SSWRITE_VALUE_DTYPE_2DMAT
(data typed matrix)
Argument
|
Description
|
const void *value
|
Matrix (e.g., [1+2i 3+4i; 5 6] )
|
int_T nRows
|
Number of rows in matrix
|
int_T nCols
|
Number of columns in matrix
|
int_T dtInfo
|
Data type (see Specifying Data Type Info)
|
SSWRITE_VALUE_DTYPE_ML_VECTOR
(data typed MATLAB vector)
Argument
|
Description
|
const void *RValue
|
Real component of vector (e.g., [1 3] )
|
const void *IValue
|
Imaginary component of vector (e.g., [2 5] )
|
int_T vectLen
|
Number of elements in vector
|
int_T dtInfo
|
Data type (see Specifying Data Type Info)
|
-
SSWRITE_VALUE_DTYPE_ML_2DMAT
(data typed MATLAB matrix)
Argument
|
Description
|
const void *RValue
|
Real component of matrix (e.g., [1 5 3 6] )
|
const void *IValue
|
Real component of matrix (e.g., [ 2 0 4 0] )
|
int_T nRows
|
Number of rows in matrix
|
int_T nCols
|
Number of columns in matrix
|
int_T dtInfo
|
Data type (see Specifying Data Type Info)
|
Example
See simulink/src/sfun_multiport.c
for an example that uses this function.
Languages
C
See Also
mdlRTW
| ssWriteRTWParameters | | ssWriteRTWScalarParam |  |