| 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 |
A tunable parameter is a block parameter whose value can be changed at run-time. A tunable parameter is inherently noninlined. Consequently, when Inlined parameters is off, all parameters are members of model_P, and thus are tunable. A tunable expression is an expression that contains one or more tunable parameters.
When you declare a parameter tunable, you control whether or not the parameter is stored within model_P. You also control the symbolic name of the parameter in the generated code.
When you declare a parameter tunable, you specify
The storage class of the parameter.
The storage class property of a parameter specifies how the Real-Time Workshop product declares the parameter in generated code.
The term "storage class," as used in the Real-Time Workshop product, is not synonymous with the term storage class specifier, as used in the C language.
A storage type qualifier, such as const or volatile. This is simply a string that is included in the variable declaration, without error checking.
(Implicitly) the symbolic name of the variable or field in which the parameter is stored. The Real-Time Workshop product derives variable and field names from the names of tunable parameters.
The Real-Time Workshop product generates a variable or struct storage declaration for each tunable parameter. Your choice of storage class controls whether the parameter is declared as a member of model_P or as a separate global variable.
You can use the generated storage declaration to make the variable visible to external legacy code. You can also make variables declared in your code visible to the generated code. You are responsible for properly linking your code to generated code modules.
You can use tunable parameters or expressions in your root model and in masked or unmasked subsystems, subject to certain restrictions. (See Tunable Expressions.)
When the Inline parameters option is selected, you can use the Model Parameter Configuration dialog box to remove individual parameters from inlining and declare them to be tunable. This allows you to improve overall efficiency by inlining most parameters, while at the same time retaining the flexibility of run-time tuning for selected parameters. Another way you can achieve the same result is by using Simulink data objects; see Simulink Data Object Considerations for specific details.
The mechanics of declaring tunable parameters are discussed in Using the Model Parameter Configuration Dialog Box.
![]() | Nontunable Parameter Storage | Tunable Parameter Storage Classes | ![]() |

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 |