Main Content


Close Stateflow chart



sfclose closes the chart that was opened or modified most recently. Closing a chart in a Simulink® model also closes the model.


sfclose all closes all open charts.


sfclose chartName closes all open charts called chartName.


sfclose(___) enables you to specify the input arguments in the previous syntaxes by using variables or strings. For example, you can enter sfclose(var) where var is a variable set to "My Chart" or "all".


collapse all

Close the Stateflow® chart that was opened or modified most recently.


Close all open Stateflow charts.

sfclose all

Close all open Stateflow charts called MyChart.

sfclose MyChart

Close the open Stateflow chart specified by the variable chart.

chart = "My Chart";

Input Arguments

collapse all

Name of Stateflow chart to close, specified as a string scalar or character vector. If the name of the chart includes spaces, enclose the chart name in quotes. To specify the name of the chart using a variable or a string, call sfclose with its input argument enclosed in parentheses.

Example: sfclose MyChart

Example: sfclose("My Chart")

Data Types: char | string

Version History

Introduced in R2006a

See Also

| | |