| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
When parameters are MATLAB workspace variables, the Model Parameter Configuration dialog box is the recommended way to see or set the attributes of tunable parameters. In addition to that dialog box, you can also use MATLAB get_param and set_param commands.
Note You can also use Simulink.Parameter objects for tunable parameters. See Configuring Parameter Objects for Code Generation for details. |
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
Auto
ExportedGlobal
ImportedExtern
ImportedExternPointer
set_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. The number of variables and number of specified storage class settings must match. If you specify multiple variables and storage class settings, separate them with a comma.
set_param(gcs, 'TunableVars', 'k1') set_param(gcs, 'TunableVarsStorageClass','ExportedGlobal') set_param(gcs, 'TunableVarsTypeQualifier','const')
Other configuration parameters you can get and set are listed in Configuration Parameters for Simulink Models in the Real-Time Workshop Reference.
![]() | Tunable Workspace Parameter Data Type Considerations | Signal Considerations | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |