MATLAB: Do I receive an error when generating code from a Stateflow model with MATLAB function calls in Real-Time Workshop 7.0 (R2007b)

simulink coder

I created a model in Stateflow with some calls to MATLAB functions using ML namespace operator. When I generate code for the model I receive the following error :
RTW incompatible MATLAB function

Best Answer

This error is due to the fact that the ability to generate code for MATLAB function calls in Stateflow is not available in Real-Time Workshop 7.0 (R2007b) as specified in the documentation :
<http://www.mathworks.com/access/helpdesk/help/toolbox/stateflow/ug/f0-59542.html#brbyg21>
As a workaround you can call MATLAB functions in Embedded MATLAB functions (EML) which is supported by Real-Time Workshop for a subset of MATLAB functions.
Here is some documentation about using EML in Stateflow :
<http://www.mathworks.com/access/helpdesk/help/toolbox/stateflow/ug/f6-6010.html>
Here is some documentation about supported MATLAB functions for EML :
<http://www.mathworks.com/access/helpdesk/help/toolbox/eml/ug/bq1h2z7-9.html>