| Contents | Index |
int_T ssWriteRTWParameters(SimStruct *S, int_T nParams, int_T paramType, const char_T *paramName, const char_T *stringInfo, ...)
SimStruct representing an S-Function block.
Number of tunable parameters.
Type of parameter (see Parameter Type-Specific Arguments).
Name of the parameter.
General information about the parameter, such as how it was derived.
Remaining arguments depend on the parameter type (see Parameter Type-Specific Arguments).
An int_T (1 or 0) or boolean_T (true or false) indicating the success or failure of the function.
Use this function in mdlRTW to write tunable parameter information to this S-function's model.rtw file. Your S-function must write the parameters out in the same order as they are declared at the beginning of the S-function.
Note This function is provided for compatibility with S-functions that do not use run-time parameters and will be deprecated in future releases. It is suggested that you use run-time parameters (see Run-Time Parameters). If you do use run-time parameters, you do not need to use this function. |
This section lists the parameter-specific arguments required by each parameter type.
SSWRITE_VALUE_VECT (vector parameter)
| Argument | Description |
|---|---|
| const real_T *valueVect | Pointer to an array of vector values |
| int_T vectLen | Length of the vector |
SSWRITE_VALUE_2DMAT (matrix parameter)
| Argument | Description |
|---|---|
| const real_T *valueMat | Pointer to an array of matrix elements |
| int_T nRows | Number of rows in the matrix |
| int_T nCols | Number of columns in the matrix |
SSWRITE_VALUE_DTYPE_2DMAT
| Argument | Description |
|---|---|
| const real_T *valueMat | Pointer to an array of matrix elements |
| int_T nRows | Number of rows in the matrix |
| int_T nCols | Number of columns in the matrix |
| int_T dtInfo | Data type of matrix elements (see Specifying Data Type Info) |
SSWRITE_VALUE_DTYPE_ML_VECT
| Argument | Description |
|---|---|
| const void *rValueVect | Real component of the complex vector |
| const void *iValueVect | Imaginary component of the complex vector |
| int_T vectLen | Length of the vector |
| int_T dtInfo | Data type of the vector (see Specifying Data Type Info) |
SSWRITE_VALUE_DTYPE_ML_2DMAT
| Argument | Description |
|---|---|
| const void *rValueMat | X |
| const void *iValueMat | Imaginary component of the complex matrix |
| int_T nRows | Number of rows in the matrix |
| int_T nCols | Number of columns in the matrix |
| int_T dtInfo | Data type of matrix |
You obtain the data type of the value argument passed to the ssWriteRTW macros using
DTINFO(dTypeId, isComplex)
where dTypeId can be any one of the enum values in DTypeID (SS_DOUBLE, SS_SINGLE, SS_INT8, SS_UINT8, SS_INT16, SS_UINT16, SS_INT32, SS_UINT32, SS_BOOLEAN) defined in simstuc_types.h. The isComplex argument is either 0 or 1.
For example, DTINFO(SS_INT32,0) is a noncomplex 32-bit signed integer.
If isComplex==1, the array of values is assumed to have the real and imaginary parts arranged in an interleaved manner (i.e., Simulink format). If you prefer to pass the real and imaginary parts as two separate arrays, you should use the macro ssWriteRTWMxVectParam or ssWriteRTWMx2dMatParam.
C, C++

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 |