| Simulink® | ![]() |
| On this page… |
|---|
A model file is a structured ASCII file that contains keywords and parameter-value pairs that describe the model. The file describes model components in hierarchical order.
The structure of the model file is as follows.
Model {
<Model Parameter Name> <Model Parameter Value>
...
Array {
Simulink.ConfigSet {
$ObjectID <Object ID>
<ConfigSet Parameter Name> <ConfigSet Parameter Value>
...
}
}
Simulink.ConfigSet {
$PropName "ActiveConfigurationSet"
$ObjectID <Object ID>
}
BlockDefaults {
<Block Parameter Name> <Block Parameter Value>
...
}
BlockParameterDefaults {
Block {
<Block Parameter Name> <Block Parameter Value>
...
}
}
AnnotationDefaults {
<Annotation Parameter Name> <Annotation Parameter Value>
...
}
LineDefaults {
<Line Parameter Name> <Line Parameter Value>
...
}
System {
<System Parameter Name> <System Parameter Value>
...
Block {
<Block Parameter Name> <Block Parameter Value>
...
}
Line {
<Line Parameter Name> <Line Parameter Value>
...
Branch {
<Branch Parameter Name> <Branch Parameter Value>
...
}
}
Annotation {
<Annotation Parameter Name> <Annotation Parameter Value>
...
}
}
}
See Model and Block Parameters for descriptions of model and block parameters.
This reference contains examples of each section, extracted from the model file of the following model:

The Model section, located at the top of the model file, contains all other sections of the model file and defines the values for model-level parameters. These parameters include the model name, the version of Simulink® software last used to modify the model, and configuration set parameters (see Configuration Sets) among others.
The following example shows parts of the Model section for a model.
Model {
Name "my_model"
Version 6.4
MdlSubVersion 0
GraphicalInterface {
NumRootInports 0
NumRootOutports 0
ParameterArgumentNames ""
ComputedModelVersion "1.10"
NumModelReferences 0
NumTestPointedSignals 0
}
SavedCharacterEncoding "windows-1252"
SaveDefaultBlockParams on
...
Array {
Type "Handle"
Dimension 2
Simulink.ConfigSet {
$ObjectID 1
Version "1.2.0"
Array {
Type "Handle"
Dimension 7
Simulink.SolverCC {
...
}
...
}
...
}
...
}
...
}The Simulink.ConfigSet section appears after the configuration set parameters. This section identifies the active configuration set for the model (see The Active Set).
The following example shows the Simulink.ConfigSet section for a model.
Simulink.ConfigSet {
$PropName "ActiveConfigurationSet"
$ObjectID 1
}The BlockDefaults section appears after the Simulink.ConfigSet section. This section defines the default values for common block parameters in the model. These values can be overridden by individual block parameters, defined in Block subsections of System sections.
The following example shows the BlockDefaults section for a model.
BlockDefaults {
Orientation "right"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
NamePlacement "normal"
FontName "Arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
ShowName on
}The BlockParameterDefaults section appears after the BlockDefaults section. This section defines the default values for block-specific parameters using Block subsections. Each Block subsection defines the default parameter-value pairs for a particular type of block in the model. These values can be overridden by individual block parameters, defined in Block subsections of System sections.
The following example shows part of the BlockParameterDefaults section for a model.
BlockParameterDefaults {
Block {
BlockType Constant
}
Block {
BlockType Display
Format "short"
Decimation "10"
Floating off
SampleTime "-1"
}
...
}The AnnotationDefaults section appears after the BlockParameterDefaults section. This section defines the default parameters for all annotations in the model (see Simulink.Annotation).
The following example shows the AnnotationDefaults section for a model.
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Courier New"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}The LineDefaults section appears after the AnnotationDefaults section. This section defines the default parameters for all lines in the model.
The following example shows the LineDefaults section for a model.
LineDefaults {
FontName "Courier New"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}The top-level system and each subsystem in the model are described in a separate System section. Each System section defines system-level parameters and includes Block, Line, and Annotation sections for each block, line, and annotation in the system. Each Line that contains a branch point includes a Branch section that defines the branch line.
The following example shows parts of the System section for a model.
System {
Name "my_model"
Location [480, 85, 1206, 386]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
...
Block {
BlockType Constant
Name "Constant"
Position [65, 100, 95, 130]
Value "2"
...
}
...
Line {
SrcBlock "Gain"
SrcPort 1
Points [25, 0]
Branch {
Points [0, 70]
DstBlock "Scope"
DstPort 1
}
Branch {
Points [20, 0]
DstBlock "Display"
DstPort 1
}
}
...
Annotation {
Name "This model generates..."
Position [149, 234]
UseDisplayTextAsClickCallback off
}
}
![]() | Model File Format | Model Advisor Checks | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |