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>
Best Answer