MATLAB: Do I get the error “Unsupported custom storage class ‘Default’ for symbolic dimension”

simulink test

When I generate code for my model with Embedded Coder, I see the following error in the diagnostic viewer during the build:
Unsupported custom storage class 'Default' for symbolic dimension A. Specify one of the following custom storage classes:
- Define or ImportedDefine with header file specified
- CompilerFlag - SystemConstant (AUTOSAR.Parameter)
- User-defined custom storage class that defines data as a macro in a specified header file
To disable symbolic dimension propagation, search for 'Allow symbolic dimension specification' in the Configuration Parameters dialog box and clear the checkbox.

Best Answer

This error occurs when Simulink.Parameter objects have an "auto" storage class for implementing symbolic dimensions. In other words, the Simulink.Parameter is used to define the port dimension of a block. See here for more details:
You can fix the error in two ways:
1. As the error message suggests, disable "Allow symbolic dimension specification" in the Configuration Parameters. Be careful as this may cause clashes in parameter tunability. For instance, Embedded Coder recognizes the "Define" storage class as tunable, however after disabling the above configuration, certain parameters may be required to be non-tunable.
2. Adjust the storage class of the Simulink.Parameter in the Model Explorer/Model Data Editor to one of the required storage classes as per the error message. See here for details about the use cases of each different storage class:
Note that in either case, you should avoid using the same Simulink.Parameter object in multiple scenarios if it were to require different storages classes in each place it's used in the model. In this case, consider making a separate Simulink.Parameter object instead.