Simulink.Bus.createMATLABStruct
Create MATLAB structures that use the same hierarchy and attributes as buses
Syntax
Description
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. For improved speed, put the model in compile before using the function multiple times. For example, to put thevdp
model in compile, use this command:vdp([],[],[],'compile')
After you create the MATLAB structure, terminate the compile by using this command:
vdp([],[],[],'term')
You can use the Type Editor to invoke the
Simulink.Bus.createMATLABStruct
function. In the Type Editor, select theBus
object for which you want to create a MATLAB structure. Then, in the toolstrip, click MATLAB Structure.You can edit the MATLAB structure in the MATLAB Editor and evaluate the code to create or update the values in this structure.
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