Simulink.Bus.createMATLABStruct
Create MATLAB structures that use same hierarchy and attributes as buses
Syntax
Description
creates one or more MATLAB® structures that have the same hierarchy and attributes as the
buses specified by S
= Simulink.Bus.createMATLABStruct(busSource
)busSource
. The resulting structures use
the ground values of the buses. Use this syntax to create initialization
structures for multiple bus ports.
Examples
Input Arguments
Output Arguments
Tips
If you use the
Simulink.Bus.createMATLABStruct
function repeatedly for the same model, for example, in a loop in a script, you can improve performance by avoiding multiple model compilations. To improve speed, put the model in compile before using the function multiple times. For example, to put a model namedmymodel
in compile, use this command.mymodel([],[],[],'compile')
After you create the MATLAB structure, terminate the compile by using this command.
mymodel([],[],[],'term')
The Type Editor can invoke the
Simulink.Bus.createMATLABStruct
function. In the Type Editor, right-click aSimulink.Bus
object for which you want to create a MATLAB structure. Then, click Create MATLAB Structure.You can edit the MATLAB structure in the MATLAB Editor. To create or update the values in this structure, evaluate the code.
You can use the
Simulink.Bus.createMATLABStruct
function to specify the initial value of the output of a referenced model.
Version History
Introduced in R2010a