📄 hz_c_code.mdl
字号:
Format "short"
Decimation "10"
Floating off
SampleTime "-1"
}
Block {
BlockType FrameConversion
OutFrame "Frame based"
}
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 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 "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType SubSystem
ShowPortLabels "FromPortIcon"
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
TreatAsAtomicUnit off
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Terminator
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Arial"
FontSize 10
FontWeight "normal"
FontAngle "normal"
UseDisplayTextAsClickCallback off
}
LineDefaults {
FontName "Arial"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "hz_C_code"
Location [372, 106, 992, 407]
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"
ReportName "simulink-default.rpt"
Block {
BlockType Reference
Name "DSP\nConstant"
Ports [0, 1]
Position [60, 69, 95, 101]
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 "[2 4 ;8 10]"
SampleMode "Discrete"
discreteOutput "Sample-based"
continuousOutput "Sample-based"
sampTime "1"
framePeriod "2"
additionalParams off
allowOverrides on
dataType "Fixed-point"
isSigned off
wordLen "7"
udDataType "sfix(16)"
fracBitsMode "User-defined"
numFracBits "0"
InterpretAs1D "-inf"
Ts "-inf"
FramebasedOutput "-inf"
}
Block {
BlockType Reference
Name "DSP\nConstant1"
Ports [0, 1]
Position [65, 144, 100, 176]
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 "0"
SampleMode "Discrete"
discreteOutput "Sample-based"
continuousOutput "Sample-based"
sampTime "1"
framePeriod "2"
additionalParams off
allowOverrides on
dataType "Fixed-point"
isSigned off
wordLen "10"
udDataType "sfix(16)"
fracBitsMode "User-defined"
numFracBits "0"
InterpretAs1D "-inf"
Ts "-inf"
FramebasedOutput "-inf"
}
Block {
BlockType Display
Name "Display"
Ports [1]
Position [400, 110, 490, 140]
Decimation "1"
Lockdown off
}
Block {
BlockType SubSystem
Name "Embedded\nMATLAB Function"
Ports [2, 1]
Position [175, 76, 340, 169]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
MaskType "Stateflow"
MaskDescription "Embedded MATLAB block"
MaskDisplay "disp('hz_average3');"
MaskSelfModifiable on
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Embedded\nMATLAB Function"
Location [257, 457, 812, 717]
Open off
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 "u"
Position [20, 101, 40, 119]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "acc"
Position [20, 136, 40, 154]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Demux
Name " Demux "
Ports [1, 1]
Position [270, 160, 320, 200]
Outputs "1"
}
Block {
BlockType "S-Function"
Name " SFunction "
Tag "Stateflow S-Function hz_C_code 2"
Ports [2, 2]
Position [180, 100, 230, 160]
FunctionName "sf_sfun"
PortCounts "[2 2]"
Port {
PortNumber 2
Name "y"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Terminator
Name " Terminator "
Position [460, 171, 480, 189]
}
Block {
BlockType Outport
Name "y"
Position [460, 101, 480, 119]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock " SFunction "
SrcPort 1
Points [0, 65]
DstBlock " Demux "
DstPort 1
}
Line {
SrcBlock " Demux "
SrcPort 1
DstBlock " Terminator "
DstPort 1
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock " SFunction "
DstPort 1
}
Line {
Name "y"
Labels [0, 0]
SrcBlock " SFunction "
SrcPort 2
DstBlock "y"
DstPort 1
}
Line {
SrcBlock "acc"
SrcPort 1
DstBlock " SFunction "
DstPort 2
}
}
}
Line {
SrcBlock "DSP\nConstant"
SrcPort 1
Points [30, 0; 0, 15]
DstBlock "Embedded\nMATLAB Function"
DstPort 1
}
Line {
SrcBlock "DSP\nConstant1"
SrcPort 1
Points [25, 0; 0, -15]
DstBlock "Embedded\nMATLAB Function"
DstPort 2
}
Line {
SrcBlock "Embedded\nMATLAB Function"
SrcPort 1
DstBlock "Display"
DstPort 1
}
}
}
# Finite State Machines
#
# Stateflow Version 6.6 (R2007a) dated Jan 30 2007, 03:33:34
#
#
Stateflow {
machine {
id 1
name "hz_C_code"
created "22-Mar-2007 00:31:00"
isLibrary 0
firstTarget 10
sfVersion 66014000
}
chart {
id 2
name "Embedded\n"
"MATLAB Function"
windowPosition [225.45 330 200.25 189.75]
viewLimits [0 156.75 0 153.75]
screen [1 1 1024 768 1.333333333333333]
treeNode [0 3 0 0]
firstTransition 5
firstJunction 4
viewObj 2
machine 1
subviewS {
}
decomposition CLUSTER_CHART
type EML_CHART
firstData 6
chartFileNumber 2
disableImplicitCasting 1
eml {
name "hz_average3"
}
}
state {
id 3
labelString "eML_blk_kernel()"
position [18 64.5 118 66]
fontSize 12
chart 2
treeNode [2 0 0 0]
superState SUBCHART
subviewer 2
type FUNC_STATE
decomposition CLUSTER_STATE
eml {
isEML 1
script "function y=hz_average3(u,acc)\n"
"% returns the scalar value for \n"
"% avaergae of matrix u\n"
"% special case of avergaing 2x2 matrices using righ-shift\n"
"N=size(u,1)*size(u,2);\n"
"for i=1:N\n"
"acc(1) = acc(1) + u(i);\n"
"end;\n"
"y=bitshift(acc,-2);"
editorLayout "100 M4x1[217 242 671 364]"
treatIntsAsFixpt 0
}
}
junction {
id 4
position [23.5747 49.5747 7]
chart 2
linkNode [2 0 0]
subviewer 2
type CONNECTIVE_JUNCTION
}
transition {
id 5
labelString "{eML_blk_kernel();}"
labelPosition [32.125 19.875 102.544 14.964]
fontSize 12
src {
intersection [0 0 1 0 23.5747 14.625 0 0]
}
dst {
id 4
intersection [7 0 -1 -1 23.5747 42.5747 0 0]
}
midPoint [23.5747 24.9468]
chart 2
linkNode [2 0 0]
dataLimits [23.575 23.575 14.625 34.575]
subviewer 2
drawStyle SMART
executionOrder 1
}
data {
id 6
name "u"
linkNode [2 0 7]
scope INPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
}
complexity SF_COMPLEX_INHERITED
}
dataType "inherited"
fixptType {
slope 1
baseType SF_INT16_TYPE
}
complexity SF_COMPLEX_INHERITED
}
data {
id 7
name "y"
linkNode [2 6 8]
scope OUTPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
}
complexity SF_COMPLEX_INHERITED
frame SF_FRAME_NO
}
dataType "inherited"
fixptType {
slope 1
baseType SF_INT16_TYPE
}
complexity SF_COMPLEX_INHERITED
}
data {
id 8
name "acc"
linkNode [2 7 0]
scope INPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
primitive SF_DOUBLE_TYPE
isSigned 1
wordLength "16"
}
complexity SF_COMPLEX_INHERITED
frame SF_FRAME_INHERITED
}
dataType "inherited"
complexity SF_COMPLEX_INHERITED
}
instance {
id 9
name "Embedded\n"
"MATLAB Function"
machine 1
chart 2
}
target {
id 10
name "sfun"
description "Default Simulink S-Function Target."
machine 1
linkNode [1 0 11]
}
target {
id 11
name "rtw"
codeFlags " comments=1 statebitsets=1 databitsets=1 emitlogicalops=1 el"
"seifdetection=1 constantfolding=1 redundantloadelimination=0"
" preservenames=0 preservenameswithparent=0 exportcharts=0"
machine 1
linkNode [1 10 0]
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -