📄 sim29.mdl
字号:
SampleTime "0"
}
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"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Arial"
FontSize 12
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Arial"
FontSize 12
FontWeight "normal"
FontAngle "normal"
}
System {
Name "sim29"
Location [2, 82, 1014, 721]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "111"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Abs\nOutput Reset"
Ports [1, 1, 0, 0, 0, 0, 0, 1]
Position [405, 116, 485, 154]
BackgroundColor "magenta"
NamePlacement "alternate"
FontName "Helvetica"
FontSize 10
TreatAsAtomicUnit on
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Abs\nOutput Reset"
Location [157, 362, 564, 573]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In"
Position [60, 106, 100, 124]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
FontName "Helvetica"
FontSize 10
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType ActionPort
Name "Action"
Position [65, 35, 158, 65]
BackgroundColor "magenta"
InitializeStates "reset"
ActionType "then"
}
Block {
BlockType Abs
Name "Abs"
Position [145, 92, 190, 138]
BackgroundColor "magenta"
FontName "Helvetica"
FontSize 10
}
Block {
BlockType Outport
Name "Out"
Position [245, 106, 285, 124]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
FontName "Helvetica"
FontSize 10
IconDisplay "Port number"
BusOutputAsStruct off
OutputWhenDisabled "reset"
InitialOutput "0"
}
Line {
SrcBlock "In"
SrcPort 1
DstBlock "Abs"
DstPort 1
}
Line {
SrcBlock "Abs"
SrcPort 1
DstBlock "Out"
DstPort 1
}
}
}
Block {
BlockType Constant
Name "Constant"
Position [565, 35, 605, 55]
Orientation "down"
BackgroundColor "[0.501961, 1.000000, 1.000000]"
ShowName off
FontName "Helvetica"
FontSize 10
Value "[0 2]"
}
Block {
BlockType Constant
Name "Constant1"
Position [565, 310, 605, 330]
Orientation "up"
BackgroundColor "[0.501961, 1.000000, 1.000000]"
ShowName off
FontName "Helvetica"
FontSize 10
Value "[2 0]"
}
Block {
BlockType If
Name "If"
Ports [1, 2]
Position [325, 174, 415, 221]
BackgroundColor "magenta"
FontSize 10
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [550, 71, 555, 109]
ShowName off
FontName "Helvetica"
FontSize 10
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Mux
Name "Mux1"
Ports [2, 1]
Position [550, 251, 555, 289]
ShowName off
FontName "Helvetica"
FontSize 10
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [190, 180, 230, 220]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
ShowName off
AttributesFormatString "Period: %<period>\\nDuty cycle: %<pulsewidth>%"
FontName "Helvetica"
FontSize 10
PulseType "Time based"
Period "5"
PulseWidth "50"
Port {
PortNumber 1
Name "Input Signal"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType SubSystem
Name "Saturation between -0.75 and 0.75\nOutput held"
Ports [1, 1, 0, 0, 0, 0, 0, 1]
Position [405, 239, 485, 281]
BackgroundColor "magenta"
FontName "Helvetica"
FontSize 10
TreatAsAtomicUnit on
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
Port {
PortNumber 1
Name "Saturation - Output Held"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
System {
Name "Saturation between -0.75 and 0.75\nOutput hel"
"d"
Location [2, 82, 1014, 721]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In"
Position [55, 136, 100, 154]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
FontName "Helvetica"
FontSize 10
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType ActionPort
Name "Action"
Position [60, 59, 149, 91]
BackgroundColor "magenta"
ActionType "else"
}
Block {
BlockType Saturate
Name "Saturation"
Position [155, 121, 200, 169]
BackgroundColor "magenta"
FontName "Helvetica"
FontSize 10
UpperLimit "0.75"
LowerLimit "-0.75"
}
Block {
BlockType Outport
Name "Out"
Position [270, 137, 310, 153]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
FontName "Helvetica"
FontSize 10
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Out"
DstPort 1
}
Line {
SrcBlock "In"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [3]
Position [655, 170, 690, 210]
BackgroundColor "[1.000000, 0.501961, 0.752941]"
ShowName off
StartFcn "open_system(gcbh)"
FontName "Helvetica"
FontSize 10
Location [159, 60, 649, 761]
Open off
NumInputPorts "3"
TickLabels "on"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
axes3 "%<SignalLabel>"
}
TimeRange "10"
YMin "-1.6~-0.1~-1.5"
YMax "3.6~1.1~3.5"
DataFormat "Structure"
}
Block {
BlockType Sin
Name "Sine Wave"
Ports [0, 1]
Position [125, 115, 165, 155]
BackgroundColor "[0.501961, 0.000000, 1.000000]"
ShowName off
FontName "Helvetica"
FontSize 10
SineType "Time based"
SampleTime "0"
Port {
PortNumber 1
Name "Sin Wave"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [575, 80, 595, 100]
BackgroundColor "[1.000000, 0.501961, 0.501961]"
ShowName off
FontName "Helvetica"
FontSize 10
IconShape "round"
Inputs "++|"
Port {
PortNumber 1
Name "Output Reset"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [575, 260, 595, 280]
BackgroundColor "[1.000000, 0.501961, 0.501961]"
ShowName off
FontName "Helvetica"
FontSize 10
IconShape "round"
Inputs "|++"
Port {
PortNumber 1
Name "Output Held"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Line {
Name "Saturation - Output Held"
FontName "Helvetica"
FontSize 9
SrcBlock "Saturation between -0.75 and 0.75\nOutput held"
SrcPort 1
DstBlock "Mux1"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Abs\nOutput Reset"
SrcPort 1
Points [30, 0; 0, -35]
DstBlock "Mux"
DstPort 2
}
Line {
Name "Output Reset"
FontName "Helvetica"
FontSize 9
Labels [0, 1]
SrcBlock "Sum"
SrcPort 1
Points [15, 0; 0, 85]
DstBlock "Scope"
DstPort 1
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Sum1"
DstPort 2
}
Line {
Name "Output Held"
FontName "Helvetica"
FontSize 9
Labels [0, 0]
SrcBlock "Sum1"
SrcPort 1
Points [15, 0; 0, -65]
DstBlock "Scope"
DstPort 3
}
Line {
Name "Input Signal"
Labels [0, 0]
SrcBlock "Pulse\nGenerator"
SrcPort 1
Points [35, 0]
Branch {
DstBlock "If"
DstPort 1
}
Branch {
Points [0, -35; 215, 0; 0, 25]
DstBlock "Scope"
DstPort 2
}
}
Line {
SrcBlock "If"
SrcPort 2
Points [25, 0]
DstBlock "Saturation between -0.75 and 0.75\nOutput held"
DstPort ifaction
}
Line {
Labels [0, 0]
SrcBlock "If"
SrcPort 1
Points [25, 0]
DstBlock "Abs\nOutput Reset"
DstPort ifaction
}
Line {
Name "Sin Wave"
FontName "Helvetica"
FontSize 9
SrcBlock "Sine Wave"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Points [0, -55]
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 0]
Branch {
DstBlock "Abs\nOutput Reset"
DstPort 1
}
Branch {
Points [0, 125]
Branch {
Points [0, 60; 345, 0; 0, -40]
DstBlock "Mux1"
DstPort 2
}
Branch {
DstBlock "Saturation between -0.75 and 0.75\nOutput"
" held"
DstPort 1
}
}
}
}
Annotation {
Name " "
Position [518, 183]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -