| Contents | Index |
int_T ssWriteRTWStrVectParam(SimStruct *S, const char_T *name, const void *value, int_T size)
SimStruct representing an S-Function block.
Parameter name.
Parameter values.
Number of elements in the vector.
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 a vector of string parameters to this S-function's model.rtw file.
C, C++
The following lines write the three strings "one", "two", and "three" to a parameter named count in the model.rtw file. To create the vector of strings to pass to the ssWriteRTWStrVectParam function, enclosed the entire string in quotation marks and square brackets. Then, enclose each individual string parameter in quotation marks preceded by a backslash, as follows:
const char *str = "[\"one\",\"two\",\"three\"]";
if (!ssWriteRTWStrVectParam(S, "count", str,3)){
return;
}When code is generated for a model containing this S-function, the model.rtw file contains the line:
count ["one","two","three"]
You can access the elements of the parameter count in the S-function's TLC file. For example, the following line in the TLC file:
/* Loop number = %<count[0]> */
appears as the following comment in the generated code:
/* Loop number = one */

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 |