MATLAB: Is the “Configure…” button next to the ‘Inline Parameters’ option in a Simulink model’s Configuration Parameters grayed out even when ‘Inline Parameters’ is enabled

buttonconfigurationconfigureEmbedded Codergraygreyparameterreferencesettunable

I was looking to make some of my model parameters tunable to generate code using Embedded Coder 6.2 (R2012a).
Normally, one can select the 'Inline Parameters' option and then hit the "Configure…" button next to it to set certain variables (parameters) to have Custom Storage Classes and therefore be exempt from the inlining process in code generation.
When using a configuration set reference instead, the "Configure…" button is always grayed out, no matter what the value of 'Inline Parameters is'.
Is this by design, or is it a bug? Also, are there any ways that I could get around this to make some of my parameters tunable?

Best Answer

This is by design, as configuration set references are independent of a particular model. Therefore, one cannot access model-specific settings in this fashion.
As a workaround, you may use the command-line approach to set storage classes as in the example below. Instead of configuring a workspace object 'x' to be tunable using the unavailable option, you may create a Simulink.Parameter object in the base workspace and change its Custom Storage Class (CSC):
x = Simulink.Parameter;
x.Value = 1.0;
x.RTWInfo.StorageClass = 'ImportedExtern';
In the example above, with an 'ImportedExtern' CSC, you can then create a header file to declare the extern variable 'x':
double x = 1.0;
This header file can be included by adding the following statement in the 'Source File' section of the 'Code Generation --> Custom Code' configuration parameters.
#include "my_header_file.h"