📄 ifsub.mdl
字号:
MatFileLogging on
MultiInstanceERTCode off
SupportNonFinite on
SupportComplex on
PurelyIntegerCode off
SupportContinuousTime on
SupportNonInlinedSFcns on
ExtMode off
ExtModeStaticAlloc off
ExtModeTesting off
ExtModeStaticAllocSize 1000000
ExtModeTransport 0
ExtModeMexFile "ext_comm"
RTWCAPISignals off
RTWCAPIParams off
RTWCAPIStates off
GenerateASAP2 off
}
PropName "Components"
}
}
PropName "Components"
}
Name "Configuration"
SimulationMode "normal"
CurrentDlgPage "Solver"
}
PropName "ConfigurationSets"
}
Simulink.ConfigSet {
$PropName "ActiveConfigurationSet"
$ObjectID 1
}
BlockDefaults {
Orientation "right"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
NamePlacement "normal"
FontName "Arial"
FontSize 12
FontWeight "normal"
FontAngle "normal"
ShowName on
}
BlockParameterDefaults {
Block {
BlockType Abs
SaturateOnIntegerOverflow on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType ActionPort
InitializeStates "held"
ActionType "unset"
}
Block {
BlockType Constant
Value "1"
VectorParams1D on
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
}
Block {
BlockType DiscretePulseGenerator
PulseType "Sample based"
TimeSource "Use simulation time"
Amplitude "1"
Period "2"
PulseWidth "1"
PhaseDelay "0"
SampleTime "1"
VectorParams1D on
}
Block {
BlockType If
NumInputs "1"
IfExpression "u1 > 0"
ShowElse on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Inport
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
Interpolate on
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Outport
Port "1"
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 Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
Floating off
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 "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 "ifsub"
Location [135, 131, 672, 557]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "89"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Abs\nOutput Reset"
Ports [1, 1, 0, 0, 0, 0, 0, 1]
Position [285, 116, 365, 154]
NamePlacement "alternate"
FontName "Helvetica"
FontSize 10
TreatAsAtomicUnit on
MinAlgLoopOccurrences off
PropExecContextAcrossSSBoundary on
RTWSystemCode "Auto"
System {
Name "Abs\nOutput Reset"
Location [154, 493, 427, 618]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In"
Position [25, 78, 55, 92]
FontName "Helvetica"
FontSize 10
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType ActionPort
Name "Action"
Position [20, 15, 94, 36]
InitializeStates "reset"
ActionType "then"
}
Block {
BlockType Abs
Name "Abs"
Position [100, 70, 130, 100]
FontName "Helvetica"
FontSize 10
}
Block {
BlockType Outport
Name "Out"
Position [175, 78, 205, 92]
FontName "Helvetica"
FontSize 10
IconDisplay "Port number"
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 [445, 35, 485, 55]
Orientation "down"
ShowName off
FontName "Helvetica"
FontSize 10
Value "[0 2]"
}
Block {
BlockType Constant
Name "Constant1"
Position [445, 310, 485, 330]
Orientation "up"
ShowName off
FontName "Helvetica"
FontSize 10
Value "[2 0]"
}
Block {
BlockType If
Name "If"
Ports [1, 2]
Position [205, 174, 295, 221]
FontSize 10
}
Block {
BlockType SubSystem
Name "More Info"
Ports []
Position [440, 360, 565, 440]
DropShadow on
ShowName off
FontName "Helvetica"
FontSize 10
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
PropExecContextAcrossSSBoundary on
RTWSystemCode "Auto"
MaskDisplay "disp('Double click\\nhere for\\ninformation on"
"\\nthis demonstration')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "More Info"
Location [625, 448, 1085, 856]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Annotation {
Name "This demonstration shows what happens when "
"a sign wave is fed into an \nIf block. After running the simulation, the sco"
"pe shows three plots. This \ndemonstration is designed to compare the If blo"
"ck with enabled subsystems.\n\nThe first of these plots shows the original si"
"ne wave and the absolute \nvalue of the original sine wave offset by two. Th"
"e absolute value of the sine\nwave is only shown when the subsystem is execut"
"ed. This occurs between\n0 and 2.5 seconds and 5 and 7.5 seconds. When the "
"subsystem is not\nexecuted then the output of the subsystem is reset to 0. T"
"he value of 0 is\ndetermined by the initial condition of the outport. You can"
" see when \nthe subsysytem is executed by looking at the second plot. A valu"
"e of 1 \nindicates that it is executed.\n\nThe second plot shows the original"
" value of the input signal. If the signal\nis towards the top of the plot th"
"en the if subsystem related to the first plot\nis executed. If the signal is"
" towards the bottom of the plot then the else\nsubsystem related to the third"
" plot is executed. \n\nThe third plot shows the original sine wave and the s"
"aturation limited sine \nwave offset by two. The saturated value of the sine"
" wave is only shown when \nthe subsystem is executed. This occurs between 2."
"5 and 5 seconds and 7.5\nand 10 seconds."
Position [20, 40]
HorizontalAlignment "left"
VerticalAlignment "top"
FontName "Helvetica"
FontSize 10
}
Annotation {
Name "If Block Demonstration"
Position [218, 22]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -