📄 try_model.mdl
字号:
SampleTime "-1"
}
Block {
BlockType Inport
Port "1"
UseBusObject off
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
LatchByDelayingOutsideSignal off
LatchByCopyingInsideSignal off
Interpolate on
}
Block {
BlockType Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
}
Block {
BlockType Outport
Port "1"
UseBusObject off
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Scope
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "-1"
}
Block {
BlockType Sin
SineType "Time based"
TimeSource "Use simulation time"
Amplitude "1"
Bias "0"
Frequency "1"
Phase "0"
Samples "10"
Offset "0"
SampleTime "-1"
VectorParams1D on
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType ToFile
Filename "untitled.mat"
MatrixName "ans"
Decimation "1"
SampleTime "-1"
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "arial"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "Try_model"
Location [258, 83, 1008, 375]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [660, 94, 690, 126]
Floating off
Location [524, 495, 848, 734]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [450, 164, 480, 196]
Floating off
Location [192, 493, 516, 730]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
SaveName "ScopeData1"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Sin
Name "Sine Wave"
Ports [0, 1]
Position [105, 95, 135, 125]
SineType "Time based"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "Subsystem"
Ports [1, 1]
Position [325, 80, 365, 140]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Subsystem"
Location [346, 139, 716, 341]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 83, 55, 97]
IconDisplay "Port number"
}
Block {
BlockType Derivative
Name "Derivative"
Position [175, 145, 205, 175]
}
Block {
BlockType Gain
Name "Gain"
Position [150, 25, 180, 55]
Gain "100"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain1"
Position [115, 145, 145, 175]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain2"
Position [115, 75, 145, 105]
Gain "100"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [175, 75, 205, 105]
IgnoreLimit off
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [270, 60, 290, 110]
ShowName off
Inputs "|+++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "Out1"
Position [315, 78, 345, 92]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Gain2"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
DstBlock "Derivative"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [45, 0; 0, 40]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Integrator"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Derivative"
SrcPort 1
Points [20, 0; 0, -60]
DstBlock "Sum"
DstPort 3
}
Line {
SrcBlock "In1"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
Points [0, 70]
DstBlock "Gain1"
DstPort 1
}
Branch {
Points [0, -50]
DstBlock "Gain"
DstPort 1
}
Branch {
DstBlock "Gain2"
DstPort 1
}
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [0, 0]
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [200, 100, 220, 120]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType ToFile
Name "To File"
Position [280, 25, 340, 55]
Filename "error.mat"
MatrixName "in"
SampleTime "0.01"
}
Block {
BlockType ToFile
Name "To File1"
Position [440, 30, 500, 60]
Filename "u_m.mat"
MatrixName "out"
SampleTime "0.01"
}
Block {
BlockType ToFile
Name "To File2"
Position [175, 25, 235, 55]
Filename "yd.mat"
MatrixName "yd"
SampleTime "0.01"
}
Block {
BlockType ToFile
Name "To File3"
Position [620, 30, 680, 60]
Filename "ym.mat"
MatrixName "y_m"
SampleTime "0.01"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [515, 92, 575, 128]
Denominator "[3 1]"
}
Line {
SrcBlock "Subsystem"
SrcPort 1
Points [0, 0; 45, 0]
Branch {
Points [0, 0]
Branch {
DstBlock "Transfer Fcn"
DstPort 1
}
Branch {
Points [0, 0; 0, 70]
DstBlock "Scope1"
DstPort 1
}
}
Branch {
Points [0, -65]
DstBlock "To File1"
DstPort 1
}
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Points [15, 0]
Branch {
DstBlock "Scope"
DstPort 1
}
Branch {
Points [0, 110; -395, 0]
DstBlock "Sum1"
DstPort 2
}
}
Branch {
Points [0, -65]
DstBlock "To File3"
DstPort 1
}
}
Line {
SrcBlock "Sine Wave"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Sum1"
DstPort 1
}
Branch {
Points [0, -70]
DstBlock "To File2"
DstPort 1
}
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [30, 0]
Branch {
DstBlock "Subsystem"
DstPort 1
}
Branch {
Points [0, -70]
DstBlock "To File"
DstPort 1
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -