📄 line_fit.mdl
字号:
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Add1"
Ports [2, 1]
Position [235, 222, 265, 253]
Inputs "-+"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "xi-xbar"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Add2"
Ports [2, 1]
Position [305, 77, 335, 108]
Inputs "-+"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "yi-ybar"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Add3"
Ports [1, 1]
Position [435, 234, 465, 266]
Inputs "+"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Add4"
Ports [2, 1]
Position [625, 27, 655, 58]
Inputs "+-"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "b0"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Reference
Name "DSP\nConstant"
Ports [0, 1]
Position [35, 229, 70, 261]
SourceBlock "dspsrcs4/DSP\nConstant"
SourceType "DSP Constant"
ShowPortLabels "FromPortIcon"
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
Value "[-28:27]'"
SampleMode "Discrete"
discreteOutput "Frame-based"
continuousOutput "Sample-based"
sampTime "Ts"
framePeriod "N*Ts"
additionalParams off
allowOverrides on
dataType "Inherit from 'Constant value'"
isSigned on
wordLen "16"
udDataType "sfix(16)"
fracBitsMode "Best precision"
numFracBits "15"
InterpretAs1D "-inf"
Ts "-inf"
FramebasedOutput "-inf"
}
Block {
BlockType Reference
Name "Mean"
Ports [1, 1]
Position [130, 65, 185, 105]
DialogController "dspDDGCreate"
DialogControllerArgs "DataTag1"
SourceBlock "dspstat3/Mean"
SourceType "Mean"
run off
reset_popup "None"
additionalParams off
allowOverrides on
outputMode "Same as accumulator"
outputWordLength "32"
outputFracLength "30"
accumMode "Same as input"
accumWordLength "32"
accumFracLength "30"
roundingMode "Floor"
overflowMode off
LockScale off
Port {
PortNumber 1
Name "ybar"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Reference
Name "Mean1"
Ports [1, 1]
Position [120, 180, 175, 220]
DialogController "dspDDGCreate"
DialogControllerArgs "DataTag2"
SourceBlock "dspstat3/Mean"
SourceType "Mean"
run off
reset_popup "None"
additionalParams off
allowOverrides on
outputMode "Same as accumulator"
outputWordLength "32"
outputFracLength "30"
accumMode "Same as input"
accumWordLength "32"
accumFracLength "30"
roundingMode "Floor"
overflowMode off
LockScale off
Port {
PortNumber 1
Name "xbar"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [425, 152, 455, 183]
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product2"
Ports [2, 1]
Position [575, 207, 605, 238]
Inputs "*/"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "b1"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Product
Name "Product3"
Ports [2, 1]
Position [640, 117, 670, 148]
Inputs "**"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "b1*xbar"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Product
Name "Product4"
Ports [2, 1]
Position [350, 232, 380, 263]
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "Offset"
Position [820, 38, 850, 52]
IconDisplay "Port number"
}
Block {
BlockType Outport
Name "Slope"
Position [830, 218, 860, 232]
Port "2"
IconDisplay "Port number"
}
Line {
SrcBlock "DSP\nConstant"
SrcPort 1
Points [15, 0]
Branch {
Points [0, -45]
DstBlock "Mean1"
DstPort 1
}
Branch {
DstBlock "Add1"
DstPort 2
}
}
Line {
Name "xbar"
Labels [0, 0]
SrcBlock "Mean1"
SrcPort 1
Points [20, 0]
Branch {
Points [0, 30]
DstBlock "Add1"
DstPort 1
}
Branch {
Labels [1, 0]
Points [65, 0; 0, -75]
DstBlock "Product3"
DstPort 1
}
}
Line {
Name "ybar"
Labels [0, 0]
SrcBlock "Mean"
SrcPort 1
Points [30, 0]
Branch {
DstBlock "Add2"
DstPort 1
}
Branch {
Labels [2, 0]
Points [0, -50]
DstBlock "Add4"
DstPort 1
}
}
Line {
Name "yi-ybar"
Labels [3, 0]
SrcBlock "Add2"
SrcPort 1
Points [40, 0; 0, 65]
DstBlock "Product1"
DstPort 1
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "Add"
DstPort 1
}
Line {
SrcBlock "Add"
SrcPort 1
Points [25, 0; 0, 45]
DstBlock "Product2"
DstPort 1
}
Line {
Name "b1"
Labels [0, 0]
SrcBlock "Product2"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Product3"
DstPort 2
}
Branch {
DstBlock "Slope"
DstPort 1
}
}
Line {
SrcBlock "Add3"
SrcPort 1
Points [90, 0]
DstBlock "Product2"
DstPort 2
}
Line {
Name "b1*xbar"
Labels [3, 0]
SrcBlock "Product3"
SrcPort 1
Points [20, 0; 0, -50; -85, 0]
DstBlock "Add4"
DstPort 2
}
Line {
Name "xi-xbar"
Labels [0, 0]
SrcBlock "Add1"
SrcPort 1
Points [25, 0]
Branch {
DstBlock "Product4"
DstPort 1
}
Branch {
Points [0, 15]
DstBlock "Product4"
DstPort 2
}
Branch {
Points [0, -65]
DstBlock "Product1"
DstPort 2
}
}
Line {
SrcBlock "Product4"
SrcPort 1
DstBlock "Add3"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Mean"
DstPort 1
}
Branch {
Points [0, 45; 160, 0; 0, -30]
DstBlock "Add2"
DstPort 2
}
}
Line {
Name "b0"
Labels [0, 0]
SrcBlock "Add4"
SrcPort 1
DstBlock "Offset"
DstPort 1
}
Annotation {
Name "sq(xi-xbar)"
Position [359, 254]
}
}
}
Block {
BlockType Concatenate
Name "Matrix\nConcatenate"
Ports [2, 1]
Position [410, 164, 465, 206]
Mode "Multidimensional array"
}
Block {
BlockType Concatenate
Name "Matrix\nConcatenate1"
Ports [2, 1]
Position [605, 44, 660, 86]
Mode "Multidimensional array"
ConcatenateDimension "2"
}
Block {
BlockType Reference
Name "Polynomial\nEvaluation"
Ports [2, 1]
Position [560, 156, 665, 194]
SourceBlock "dsppolyfun/Polynomial\nEvaluation"
SourceType "Polynomial Evaluation"
useConstCoeffs off
constCoeffs "[5 4 3 2 1]"
}
Block {
BlockType SubSystem
Name "Simplified Linear Fit"
Ports [1, 2]
Position [210, 316, 310, 374]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
System {
Name "Simplified Linear Fit"
Location [615, 206, 1549, 689]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 78, 55, 92]
IconDisplay "Port number"
}
Block {
BlockType Sum
Name "Add"
Ports [1, 1]
Position [390, 154, 420, 186]
Inputs "+"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Add2"
Ports [2, 1]
Position [255, 77, 285, 108]
Inputs "-+"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "yi-ybar"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Sum
Name "Add4"
Ports [2, 1]
Position [625, 27, 655, 58]
Inputs "+-"
CollapseMode "All dimensions"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
Port {
PortNumber 1
Name "b0"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Reference
Name "DSP\nConstant1"
Ports [0, 1]
Position [225, 194, 260, 226]
SourceBlock "dspsrcs4/DSP\nConstant"
SourceType "DSP Constant"
ShowPortLabels "FromPortIcon"
SystemSampleTime "-1"
FunctionWithSeparateData off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -