⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sf_arraydata.mdl

📁 这是关于matlab stateflow的源码例子
💻 MDL
字号:
Model {
  Name			  "sf_arraydata"
  Version		  3.00
  SimParamPage		  "Solver"
  SampleTimeColors	  off
  InvariantConstants	  off
  WideVectorLines	  on
  ShowLineWidths	  off
  ShowPortDataTypes	  off
  StartTime		  "0.0"
  StopTime		  "10"
  SolverMode		  "Auto"
  Solver		  "FixedStepDiscrete"
  RelTol		  "1e-3"
  AbsTol		  "auto"
  Refine		  "1"
  MaxStep		  "auto"
  InitialStep		  "auto"
  FixedStep		  "auto"
  MaxOrder		  5
  OutputOption		  "RefineOutputTimes"
  OutputTimes		  "[]"
  LoadExternalInput	  off
  ExternalInput		  "[t, u]"
  SaveTime		  on
  TimeSaveName		  "tout"
  SaveState		  off
  StateSaveName		  "xout"
  SaveOutput		  on
  OutputSaveName	  "yout"
  LoadInitialState	  off
  InitialState		  "xInitial"
  SaveFinalState	  off
  FinalStateName	  "xFinal"
  SaveFormat		  "Matrix"
  LimitMaxRows		  off
  MaxRows		  "1000"
  Decimation		  "1"
  AlgebraicLoopMsg	  "warning"
  MinStepSizeMsg	  "warning"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  IntegerOverflowMsg	  "warning"
  UnnecessaryDatatypeConvMsg "none"
  Int32ToFloatConvMsg	  "warning"
  SignalLabelMismatchMsg  "none"
  ConsistencyChecking	  "off"
  ZeroCross		  on
  SimulationMode	  "normal"
  BlockDataTips		  on
  BlockParametersDataTip  on
  BlockAttributesDataTip  off
  BlockPortWidthsDataTip  off
  BlockDescriptionStringDataTip	off
  BlockMaskParametersDataTip off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  off
  OptimizeBlockIOStorage  on
  BufferReuse		  on
  BooleanDataType	  off
  RTWSystemTargetFile	  "grt.tlc"
  RTWInlineParameters	  off
  RTWRetainRTWFile	  off
  RTWTemplateMakefile	  "grt_default_tmf"
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  ExtModeMexFile	  "ext_comm"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "oneshot"
  ExtModeTrigPort	  "1"
  ExtModeTrigElement	  "any"
  ExtModeTrigDuration	  1000
  ExtModeTrigHoldOff	  0
  ExtModeTrigDelay	  0
  ExtModeTrigDirection	  "rising"
  ExtModeTrigLevel	  0
  ExtModeArchiveMode	  "off"
  ExtModeAutoIncOneShot	  off
  ExtModeIncDirWhenArm	  off
  ExtModeAddSuffixToVar	  off
  ExtModeWriteAllDataToWs off
  ExtModeArmWhenConnect	  off
  Created		  "Tue Mar 09 15:35:33 1999"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "pgoddard"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Wed Mar 10 09:10:01 1999"
  ModelVersionFormat	  "1.%<AutoIncrement:3>"
  ConfigurationManager	  "none"
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Helvetica"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "sf_arraydata"
    Location		    [5, 76, 432, 276]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "automatic"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    AutoZoom		    on
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "Chart"
      Ports		      [1, 1, 0, 1, 0]
      Position		      [145, 101, 275, 159]
      FontName		      "Arial"
      FontSize		      12
      FontWeight	      "bold"
      ShowPortLabels	      on
      MaskType		      "Stateflow"
      MaskDescription	      "Stateflow diagram"
      MaskDisplay	      "plot(sf('Private','sfblk','xIcon'),sf('Private'"
",'sfblk','yIcon'));text(0.5,0,sf('Private', 'sfblk', 'tIcon'),'HorizontalAl',"
"'Center','VerticalAl','Bottom');"
      MaskSelfModifiable      on
      MaskIconFrame	      off
      MaskIconOpaque	      off
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Chart"
	Location		[257, 457, 812, 717]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
	Block {
	  BlockType		  Inport
	  Name			  "vec_in"
	  Position		  [20, 101, 40, 119]
	  Port			  "1"
	  PortWidth		  "4"
	  SampleTime		  "-1"
	  DataType		  "auto"
	  SignalType		  "auto"
	  Interpolate		  on
	}
	Block {
	  BlockType		  TriggerPort
	  Name			  "event"
	  Ports			  [0, 1, 0, 0, 0]
	  Position		  [20, 136, 40, 154]
	  TriggerType		  "either"
	  ShowOutputPort	  on
	  OutputDataType	  "auto"
	}
	Block {
	  BlockType		  Demux
	  Name			  " Demux "
	  Ports			  [1, 1, 0, 0, 0]
	  Position		  [270, 160, 320, 200]
	  Outputs		  "1"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  " SFunction "
	  Tag			  "Stateflow S-Function sf_arraydata 1"
	  Ports			  [2, 2, 0, 0, 0]
	  Position		  [180, 100, 230, 160]
	  FunctionName		  "sf_sfun"
	  PortCounts		  "[2 2]"
	  SFunctionModules	  "''"
	}
	Block {
	  BlockType		  Terminator
	  Name			  " Terminator "
	  Position		  [460, 171, 480, 189]
	}
	Block {
	  BlockType		  Outport
	  Name			  "data_out"
	  Position		  [460, 101, 480, 119]
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "[]"
	}
	Line {
	  SrcBlock		  " Demux "
	  SrcPort		  1
	  DstBlock		  " Terminator "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  1
	  Points		  [0, 65]
	  DstBlock		  " Demux "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "vec_in"
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "event"
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  2
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  2
	  DstBlock		  "data_out"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Constant
      Name		      "Constants"
      Position		      [50, 113, 115, 147]
      FontName		      "Arial"
      FontSize		      12
      FontWeight	      "bold"
      Value		      "[0 1 2 3]"
    }
    Block {
      BlockType		      Display
      Name		      "Display"
      Ports		      [1, 0, 0, 0, 0]
      Position		      [300, 116, 395, 144]
      FontName		      "Arial"
      FontSize		      12
      FontWeight	      "bold"
      Format		      "short"
      Decimation	      "1"
      Floating		      off
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Reference
      Name		      "Pulse\nGenerator"
      Ports		      [0, 1, 0, 0, 0]
      Position		      [70, 30, 100, 60]
      FontName		      "Arial"
      FontSize		      12
      FontWeight	      "bold"
      SourceBlock	      "simulink3/Sources/Pulse\nGenerator"
      SourceType	      "Pulse Generator"
      period		      "1"
      duty		      "50"
      amplitude		      "1"
      start		      "0"
    }
    Line {
      SrcBlock		      "Pulse\nGenerator"
      SrcPort		      1
      Points		      [105, 0]
      DstBlock		      "Chart"
      DstPort		      trigger
    }
    Line {
      SrcBlock		      "Constants"
      SrcPort		      1
      DstBlock		      "Chart"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Chart"
      SrcPort		      1
      DstBlock		      "Display"
      DstPort		      1
    }
  }
}

# Finite State Machines
# -- File save dated 10-Mar-1999 09:10:02
#
#    Stateflow Version 2.0 (R11) dated Jan 21 1999, 19:12:04
#
#

Stateflow {

	machine {
		id         		1
		name       		"sf_arraydata"
		created    		"09-Mar-1999 15:35:33"
		firstTarget		12
		sfVersion  		20011061
	}

	chart {
		id                     		2
		name                   		"Chart"
		windowPosition         		[3 123 426.75 196.5]
		viewLimits             		[21.42921510453601 311.7610035909967 1.440335729505719 123.0274252326419]
		zoomFactor             		0.7575519595210977
		screen                 		[1 1 1024 768 1.333333333333333]
		treeNode               		[0 3 0 0]
		firstTransition        		5
		visible                		1
		machine                		1
		decomposition          		CLUSTER_CHART
		firstEvent             		8
		firstData              		9
		chartFileNumber        		1
	}

	state {
		id             		3
		labelString    		"s1"
		position       		[39.16454898656151 43.09219418586069 70.5239696602934 42.38691694113444]
		fontSize       		10
		chart          		2
		treeNode       		[2 0 0 4]
		type           		OR_STATE
		decomposition  		CLUSTER_STATE
	}

	state {
		id             		4
		labelString    		"s2"
		position       		[218.1127575734607 51.45547357867704 69.4972561172014 42.38691694113444]
		fontSize       		10
		chart          		2
		treeNode       		[2 0 3 0]
		type           		OR_STATE
		decomposition  		CLUSTER_STATE
	}

	transition {
		id           		5
		labelString  		"/data_out=vec_in[0]+vec_in[1]+vec_in[2]+vec_in[3]"
		labelPosition		[68.61646378980825 9.456952083974336 233.2921443830303 13.06777130173894]
		fontSize     		10
		src {
			id          		3
			intersection		[1 0 -1 0.8827250747475577 101.4178253764385 43.09219418586069]
		}
		dst {
			id          		4
			intersection		[1 0 -1 0.1813384658005498 230.7152833751019 51.45547357867704]
		}
		midPoint     		[177.7273671137764 26.77069864582485]
		chart        		2
		linkNode     		[2 0 6]
		dataLimits   		[101.4178253764385 233.1152833751019 26.6723013434142 51.45547357867704]
	}

	transition {
		id           		6
		labelPosition		[38.34979962516024 36.38237712879714 6.844757292411645 13.06777130173894]
		fontSize     		10
		src {
			intersection		[0 0 0 0 33.80631298918053 35.53017390795507]
		}
		dst {
			id          		3
			intersection		[1 0 -1 0.2643205981010862 57.80548682763313 43.09219418586069]
		}
		midPoint     		[44.04743327924759 34.5414454712511]
		chart        		2
		linkNode     		[2 5 7]
		dataLimits   		[33.80631298918061 60.20548682763313 32.53323217243235 43.09219418586069]
	}

	transition {
		id           		7
		labelString  		"/data_out=0"
		labelPosition		[132.3234115187106 98.10187973633036 55.89885122136177 13.06777130173894]
		fontSize     		10
		src {
			id          		4
			intersection		[3 0 1 0.4585482403775087 255.7421691870544 93.84239051981149]
		}
		dst {
			id          		3
			intersection		[3 0 1 0.5690127352322472 69.55948177101536 85.47911112699514]
		}
		midPoint     		[158.8023863101616 115.6412936273111]
		chart        		2
		linkNode     		[2 6 0]
		dataLimits   		[67.15948177101535 255.7421691870543 85.47911112699514 115.772997808441]
	}

	event {
		id         		8
		name       		"event"
		linkNode   		[2 0 0]
		scope      		INPUT_EVENT
		trigger    		EITHER_EDGE_EVENT
		machine    		1
	}

	data {
		id         		9
		name       		"vec_in"
		linkNode   		[2 0 10]
		scope      		INPUT_DATA
		machine    		1
		dataType   		"double"
		props {
			array {
				size      		"4"
			}
		}
	}

	data {
		id         		10
		name       		"data_out"
		linkNode   		[2 9 0]
		scope      		OUTPUT_DATA
		machine    		1
		dataType   		"double"
	}

	instance {
		id     		11
		name   		"Chart"
		machine		1
		chart  		2
	}

	target {
		id               		12
		name             		"sfun"
		description      		"Default Simulink S-Function Target."
		machine          		1
		linkNode         		[1 0 0]
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -