Stateflow.EMChart
Stateflow interface to MATLAB Function block
Description
Use Stateflow.EMChart
objects to configure MATLAB
Function (Simulink) blocks through the Stateflow® programmatic interface.
MATLAB Function blocks define custom functionality in Simulink® models. Use these blocks when:
You have an existing MATLAB® function that models custom functionality, or it is easy for you to create such a function.
Your model requires custom functionality that is not or cannot be captured in the Simulink graphical language.
You find it easier to model custom functionality by using a MATLAB function than by using a Simulink block diagram.
The custom functionality that you want to model does not include continuous or discrete dynamic states. To model dynamic states, use S-functions. See Author Blocks Using MATLAB S-Functions (Simulink).
For more information, see Implement MATLAB Functions in Simulink with MATLAB Function Blocks (Simulink).
Tip
You can also configure the properties of a MATLAB Function block
programmatically by using a MATLABFunctionConfiguration
(Simulink) object. This object provides a direct interface to
the properties of a MATLAB Function block. For more information, see Configure MATLAB Function Blocks Programmatically (Simulink).
Creation
Each MATLAB Function block has its own Stateflow.EMChart
object. When you add a MATLAB Function block to a Simulink model, a Stateflow.EMChart
object is automatically created for
it. For example, you can use the function add_block
(Simulink) to add a MATLAB Function with the name MATLAB
Function
to a model called myModel
:
add_block("simulink/User-Defined Functions/MATLAB Function", ... "myModel/MATLAB Function")
Then, to access the
Stateflow.EMChart
object, call the find
function for the Simulink.Root
object:
block = find(sfroot,"-isa","Stateflow.EMChart", ... "Path","myModel/MATLAB Function");
Properties
Object Functions
find | Identify specified objects in hierarchy |
getChildren | Identify children of object |
dialog | Open properties dialog box |
view | Display object in editing environment |
Examples
Version History
Introduced in R2011aSee Also
Blocks
- MATLAB Function (Simulink)
Functions
Objects
MATLABFunctionConfiguration
(Simulink) |MATLABFunctionReport
(Simulink)