Stateflow.exportAsClass - Export MATLAB class for standalone chart - MATLAB (original) (raw)

Main Content

Export MATLAB class for standalone chart

Syntax

Description

Stateflow.exportAsClass([source](#mw%5F51655b47-928d-4f35-93a0-e52c2ea8709a)) 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 is chart.sfx, the function saves the MATLAB class in the file chart.m.

example

Stateflow.exportAsClass([source](#mw%5F51655b47-928d-4f35-93a0-e52c2ea8709a),[destination](#mw%5Fd88b2a81-0194-4336-a2df-2239faa2b31c)) saves the chart as a MATLAB class file in the folder 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.

example

Examples

collapse all

Save Stateflow chart chart.sfx as the MATLAB class file chart.m in the current folder.

Stateflow.exportAsClass("chart.sfx");

Save Stateflow chart chart.sfx, which is located in folderdir1, as the MATLAB class file chart.m in the current folder.

Stateflow.exportAsClass(fullfile("dir1","chart.sfx"));

Save Stateflow chart chart.sfx, which is located in the current folder, as the MATLAB class file chart.m in the folderdir2.

Stateflow.exportAsClass("chart.sfx","dir2");

Input Arguments

collapse all

Path and file name of a standalone chart, specified as a string scalar or character vector. You can use the absolute path from the root folder or the relative path from the current folder. Standalone charts have the extension .sfx.

Data Types: char | string

Path of the destination folder for the MATLAB class file, specified as a string scalar or character vector. You can use the absolute path from the root folder or the relative path from the current folder. If not specified, the function saves the MATLAB script file in the current folder.

Data Types: char | string

Tips

Version History

Introduced in R2019b