Main Content

sfnew

Create Simulink model that contains an empty Stateflow block

Description

example

sfnew creates an untitled Simulink® model that contains an empty Stateflow® chart.

example

sfnew chartType creates an untitled model that contains an empty block of type chartType.

example

sfnew modelName creates a model called modelName that contains an empty chart.

example

sfnew chartType modelName creates a model called modelName that contains an empty block of type chartType.

example

sfnew(___) enables you to specify the input arguments in the previous syntaxes by using variables or strings. For example, you can enter sfnew(var1,var2) where var1 is a variable set to "-C" and var2 is a variable set to "MyModel".

Examples

collapse all

Create an untitled model that contains an empty Stateflow chart that uses the default action language for new charts.

sfnew

For more information, see Modify the Action Language for a Chart.

Create an untitled model called MyModel that contains an empty Truth Table block.

sfnew -TT

Create a model called MyModel that contains an empty Stateflow chart that uses MATLAB® as the action language.

sfnew 'MyModel'

Create a model called MyModel that contains an empty Stateflow chart that uses Moore semantics.

sfnew -Moore 'MyModel'

Create an untitled model that contains an empty Stateflow chart of the type specified by the variable type.

type = "-C";
sfnew(type)

Input Arguments

collapse all

Type of Stateflow block to add to empty model, specified as one of these options:

  • -MATLAB or -MChart that uses MATLAB as the action language

  • -C — Chart that uses C as the action language

  • -Mealy — Chart that supports Mealy machine semantics

  • -Moore — Chart that supports Moore machine semantics

  • -STTState Transition Table

  • -TTTruth Table

To specify the type of the block using a variable or a string, call sfnew with its input arguments enclosed in parentheses.

Example: sfnew -MATLAB

Example: sfnew '-MATLAB'

Example: sfnew("-MATLAB")

Data Types: char | string

Name of the Simulink model, specified as a character vector or string. To specify the name of the model using a variable or a string, call sfnew with its input arguments enclosed in parentheses.

Example: sfnew MyModel

Example: sfnew 'MyModel'

Example: sfnew("MyModel")

Data Types: char | string

Tips

Introduced before R2006a