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

📄 sampled_updates.mdl

📁 这是关于matlab stateflow的源码例子
💻 MDL
字号:
Model {
  Name			  "sampled_updates"
  Version		  3.00
  SimParamPage		  "Solver"
  SampleTimeColors	  off
  InvariantConstants	  off
  WideVectorLines	  off
  ShowLineWidths	  off
  ShowPortDataTypes	  off
  StartTime		  "0.0"
  StopTime		  "10.0"
  SolverMode		  "Auto"
  Solver		  "ode45"
  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		  "Thu Jan 21 13:28:52 1999"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "pgoddard"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Wed Mar 10 08:32:53 1999"
  ModelVersionFormat	  "1.%<AutoIncrement:8>"
  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		    "sampled_updates"
    Location		    [8, 75, 343, 209]
    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		      Scope
      Name		      "Scope"
      Ports		      [1, 0, 0, 0, 0]
      Position		      [260, 39, 290, 71]
      Floating		      off
      Location		      [6, 257, 345, 496]
      Open		      on
      NumInputPorts	      "1"
      TickLabels	      "OneTimeTick"
      ZoomMode		      "on"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      Grid		      "on"
      TimeRange		      "10"
      YMin		      "-1"
      YMax		      "1"
      SaveToWorkspace	      off
      SaveName		      "ScopeData"
      DataFormat	      "StructureWithTime"
      LimitMaxRows	      on
      MaxRows		      "5000"
      Decimation	      "1"
      SampleInput	      off
      SampleTime	      "0"
    }
    Block {
      BlockType		      Sin
      Name		      "Sine Wave"
      Position		      [70, 40, 100, 70]
      Amplitude		      "1"
      Frequency		      "1"
      Phase		      "0"
      SampleTime	      "0"
    }
    Block {
      BlockType		      SubSystem
      Name		      "zero order hold"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [150, 29, 210, 81]
      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			"zero order hold"
	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			  "in"
	  Position		  [20, 101, 40, 119]
	  Port			  "1"
	  PortWidth		  "1"
	  SampleTime		  "-1"
	  DataType		  "auto"
	  SignalType		  "auto"
	  Interpolate		  on
	}
	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 sampled_updates 1"
	  Ports			  [1, 2, 0, 0, 0]
	  Position		  [180, 100, 230, 160]
	  FunctionName		  "sf_sfun"
	  PortCounts		  "[1 2]"
	  SFunctionModules	  "''"
	}
	Block {
	  BlockType		  Terminator
	  Name			  " Terminator "
	  Position		  [460, 171, 480, 189]
	}
	Block {
	  BlockType		  Outport
	  Name			  "out"
	  Position		  [460, 101, 480, 119]
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "[]"
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  1
	  Points		  [0, 65]
	  DstBlock		  " Demux "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " Demux "
	  SrcPort		  1
	  DstBlock		  " Terminator "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "in"
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  2
	  DstBlock		  "out"
	  DstPort		  1
	}
      }
    }
    Line {
      SrcBlock		      "Sine Wave"
      SrcPort		      1
      DstBlock		      "zero order hold"
      DstPort		      1
    }
    Line {
      SrcBlock		      "zero order hold"
      SrcPort		      1
      DstBlock		      "Scope"
      DstPort		      1
    }
  }
}

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

Stateflow {

	machine {
		id         		1
		name       		"sampled_updates"
		created    		"21-Jan-1999 13:28:52"
		firstTarget		9
		sfVersion  		20011061
	}

	chart {
		id                     		2
		name                   		"zero order hold"
		windowPosition         		[267 375.75 240.75 166.5]
		viewLimits             		[18.56505988645353 149.3264495265617 11.91013390733254 98.42147153995165]
		zoomFactor             		0.66292212745302
		screen                 		[1 1 1024 768 1.333333333333333]
		treeNode               		[0 3 0 0]
		firstTransition        		4
		visible                		1
		machine                		1
		decomposition          		CLUSTER_CHART
		firstData              		6
		updateMethod           		DISCRETE
		sampleTime             		"0.4"
		chartFileNumber        		1
	}

	state {
		id             		3
		labelString    		"ZOH\n"
						"out=in;"
		position       		[71.7246010578605 34.03515991107711 66.28579749921465 43.75286041189929]
		fontSize       		10
		arrowSize      		5.30337701962416
		chart          		2
		treeNode       		[2 0 0 0]
		type           		OR_STATE
		decomposition  		CLUSTER_STATE
	}

	transition {
		id           		4
		labelPosition		[29.88111085594012 44.92379043042998 6.463490742666945 12.42978988974412]
		fontSize     		10
		arrowSize    		5.30337701962416
		src {
			intersection		[0 0 0 0 47.09843265645678 32.54358512430781]
		}
		dst {
			id          		3
			intersection		[4 -1 0 0.8125000000000001 71.7246010578605 42.23882123830822]
		}
		midPoint     		[54.0267420004432 36.585956744831]
		chart        		2
		linkNode     		[2 0 5]
		dataLimits   		[47.09843265645678 71.7246010578605 32.54358512430781 43.82983434419547]
	}

	transition {
		id           		5
		labelPosition		[44.4084152194096 61.07957154204104 4.474724360307886 8.94944872061577]
		fontSize     		6.629221274530201
		arrowSize    		5.30337701962416
		src {
			id          		3
			intersection		[4 -1 0 0.1874999999999999 71.7246010578605 69.58435899574529]
		}
		dst {
			id          		3
			intersection		[4 -1 0 0.6 71.7246010578605 51.53630407583682]
		}
		midPoint     		[42.99508355087019 63.56834068910911]
		chart        		2
		linkNode     		[2 4 0]
		dataLimits   		[42.98822107014898 71.7246010578605 49.94529096994957 69.58909972999162]
	}

	data {
		id         		6
		name       		"in"
		linkNode   		[2 0 7]
		scope      		INPUT_DATA
		machine    		1
		dataType   		"double"
	}

	data {
		id         		7
		name       		"out"
		linkNode   		[2 6 0]
		scope      		OUTPUT_DATA
		machine    		1
		dataType   		"double"
	}

	instance {
		id     		8
		name   		"zero order hold"
		machine		1
		chart  		2
	}

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

⌨️ 快捷键说明

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