MATLAB: Does compiling a model containing Embedded MATLAB blocks using the GRT system target file take a long time in Real-Time Workshop 7.1 (R2008a)

simulink coder

I have a model which contains an Embedded MATLAB block and I pass large structures to it. The compilation takes several minutes while my other models compile without any substantial delays.

Best Answer

This enhancement has been incorporated in Release 2009b (R2009b). For previous product releases, read below for any possible workarounds:
The presence of large non-tunable parameters makes Embedded MATLAB compilation extremely slow. Since the value of a non-tunable parameter is known beforehand, Embedded MATLAB spends a lot of time trying to optimize the generated code based on the value and therefore results in a compilation delay.
Since tunable structures are not supported by Embedded MATLAB, in order to work around this issue, use arrays instead of structures for parameters.