Stateflow.exportAsClass
Export MATLAB class for standalone chart
Description
Stateflow.exportAsClass(
saves a
standalone Stateflow® chart as a MATLAB® class file in the current folder. The saved file has the same name as the
chart. For example, if source
)source
is chart.sfx
, the
function saves the MATLAB class in the file chart.m
.
Stateflow.exportAsClass(
saves the chart as a MATLAB class file in the folder source
,destination
)destination
.
Note
The MATLAB class produced by Stateflow.exportAsClass
is intended
for debugging purposes only, and not for production use or manual modification. For more
information, see Tips.
Examples
Input Arguments
Tips
Use the code produced by
Stateflow.exportAsClass
to debug run-time errors that are otherwise difficult to diagnose. For example, suppose that you encounter an error while executing a Stateflow chart that controls a MATLAB application. If you export the chart as a MATLAB class file, you can replace the chart with the class in your application and diagnose the error by using the MATLAB debugger.Note
Error messages produced by the MATLAB class point to different line numbers than the corresponding error messages produced by the Stateflow chart.
When you execute the MATLAB class produced by
Stateflow.exportAsClass
, the Stateflow Editor does not animate the original chart.
Version History
Introduced in R2019b