| Real-Time Workshop User's Guide | ![]() |
Parameter Tuning via MATLAB Commands
The Model Parameter Configuration dialog is the recommended way to see or set the attributes of tunable parameters. However, you can also use MATLAB get_param and set_param commands.
The following commands return the tunable parameters and/or their attributes:
get_param(gcs, 'TunableVars')get_param(gcs, 'TunableVarsStorageClass')get_param(gcs, 'TunableVarsTypeQualifier')The following commands declare tunable parameters or set their attributes:
set_param(gcs, 'TunableVars', str)The argument str (string) is a comma-separated list of variable names.
set_param(gcs, 'TunableVarsStorageClass', str)The argument str (string) is a comma-separated list of storage class settings.
The valid storage class settings are:
AutoExportedGlobalImportedExternImportedExternPointerset_param(gcs, 'TunableVarsTypeQualifier', str)The argument str (string) is a comma-separated list of storage type qualifiers.
The following example declares the variable k1 to be tunable, with storage class ExportedGlobal and type qualifier const.
set_param(gcs, 'TunableVars', 'k1')
set_param(gcs, 'ExportedGlobal')
set_param(gcs, 'TunableVarsTypeQualifier','const')
| Target Language Compiler API for Parameter Tuning and Signal Monitoring | Simulink Data Objects and Code Generation | ![]() |