The workflow is possible in 17b by using one of the following ways:
1. Setting the storage class of the signal to SimulinkGlobal. With this approach, the signal is preserved and its name is not mangled. Please note that in R2018a, SimulinkGlobal was renamed to "Model default". If the model’s default storage class for internal data is "Default" then the behavior is the same as described above. If the model’s default storage class is a single-instance-only storage class (like ExportedGlobal) then this will error out.
2. You may enable signal logging by checking the following option on the Model Configuration Parameters: Code Generation > Interface (Advanced Parameters) > MAT-file logging
3. You may enable Testpoint for the signal. Please uncheck the option "Ignore testpoints" setting in ConfigSet or the signal may be optimized away from generated code. With this option, the signal is preserved but name may be mangled.
Best Answer