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

📄 temperal_test.mdl

📁 这是关于matlab stateflow的源码例子
💻 MDL
字号:
Model {
  Name			  "temperal_test"
  Version		  4.00
  SampleTimeColors	  off
  LibraryLinkDisplay	  "none"
  WideLines		  off
  ShowLineDimensions	  off
  ShowPortDataTypes	  off
  ShowStorageClass	  off
  ExecutionOrder	  off
  RecordCoverage	  off
  CovPath		  "/"
  CovSaveName		  "covdata"
  CovMetricSettings	  "dw"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  BlockNameDataTip	  off
  BlockParametersDataTip  off
  BlockDescriptionStringDataTip	off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  off
  Created		  "Fri Mar 21 09:56:29 2003"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "wyh"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Fri Mar 21 16:48:45 2003"
  ModelVersionFormat	  "1.%<AutoIncrement:11>"
  ConfigurationManager	  "None"
  SimParamPage		  "Solver"
  StartTime		  "0.0"
  StopTime		  "inf"
  SolverMode		  "Auto"
  Solver		  "ode45"
  RelTol		  "1e-3"
  AbsTol		  "auto"
  Refine		  "1"
  MaxStep		  "auto"
  MinStep		  "auto"
  MaxNumMinSteps	  "-1"
  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		  "Array"
  LimitDataPoints	  on
  MaxDataPoints		  "1000"
  Decimation		  "1"
  AlgebraicLoopMsg	  "warning"
  MinStepSizeMsg	  "warning"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  SingleTaskRateTransMsg  "none"
  MultiTaskRateTransMsg	  "error"
  IntegerOverflowMsg	  "warning"
  CheckForMatrixSingularity "none"
  UnnecessaryDatatypeConvMsg "none"
  Int32ToFloatConvMsg	  "warning"
  InvalidFcnCallConnMsg	  "error"
  SignalLabelMismatchMsg  "none"
  LinearizationMsg	  "none"
  VectorMatrixConversionMsg "none"
  SfunCompatibilityCheckMsg "none"
  BlockPriorityViolationMsg "warning"
  ArrayBoundsChecking	  "none"
  ConsistencyChecking	  "none"
  ZeroCross		  on
  Profile		  off
  SimulationMode	  "normal"
  RTWSystemTargetFile	  "grt.tlc"
  RTWInlineParameters	  off
  RTWRetainRTWFile	  off
  RTWTemplateMakefile	  "grt_default_tmf"
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  TLCProfiler		  off
  TLCDebug		  off
  TLCCoverage		  off
  AccelSystemTargetFile	  "accel.tlc"
  AccelTemplateMakefile	  "accel_default_tmf"
  AccelMakeCommand	  "make_rtw"
  TryForcingSFcnDF	  off
  ExtModeMexFile	  "ext_comm"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "normal"
  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	  on
  ExtModeSkipDownloadWhenConnect off
  ExtModeLogAll		  on
  ExtModeAutoUpdateStatusClock on
  OptimizeBlockIOStorage  on
  BufferReuse		  on
  ParameterPooling	  on
  BlockReductionOpt	  on
  RTWExpressionDepthLimit 5
  BooleanDataType	  off
  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		    "temperal_test"
    Location		    [601, 124, 1101, 424]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "automatic"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "A4"
    PaperUnits		    "centimeters"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "Chart"
      Ports		      [0, 2, 0, 1]
      Position		      [215, 86, 275, 139]
      ShowPortLabels	      on
      TreatAsAtomicUnit	      on
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      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		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  TriggerPort
	  Name			  "CLK"
	  Ports			  [0, 1]
	  Position		  [20, 101, 40, 119]
	  TriggerType		  "either"
	  ShowOutputPort	  on
	  OutputDataType	  "auto"
	}
	Block {
	  BlockType		  Demux
	  Name			  " Demux "
	  Ports			  [1, 1]
	  Position		  [270, 180, 320, 220]
	  Outputs		  "1"
	  BusSelectionMode	  off
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  " SFunction "
	  Tag			  "Stateflow S-Function temperal_test 1"
	  Ports			  [1, 3]
	  Position		  [180, 100, 230, 180]
	  FunctionName		  "sf_sfun"
	  PortCounts		  "[1 3]"
	  SFunctionModules	  "''"
	  Port {
	    PortNumber		    2
	    Name		    "ig"
	    TestPoint		    off
	    LinearAnalysisOutput    off
	    LinearAnalysisInput	    off
	    RTWStorageClass	    "Auto"
	  }
	  Port {
	    PortNumber		    3
	    Name		    "x_clutch"
	    TestPoint		    off
	    LinearAnalysisOutput    off
	    LinearAnalysisInput	    off
	    RTWStorageClass	    "Auto"
	  }
	}
	Block {
	  BlockType		  Terminator
	  Name			  " Terminator "
	  Position		  [460, 191, 480, 209]
	}
	Block {
	  BlockType		  Outport
	  Name			  "ig"
	  Position		  [460, 101, 480, 119]
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "[]"
	}
	Block {
	  BlockType		  Outport
	  Name			  "x_clutch"
	  Position		  [460, 136, 480, 154]
	  Port			  "2"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "[]"
	}
	Line {
	  SrcBlock		  " Demux "
	  SrcPort		  1
	  DstBlock		  " Terminator "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  1
	  Points		  [0, 85]
	  DstBlock		  " Demux "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "CLK"
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  1
	}
	Line {
	  Name			  "ig"
	  Labels		  [0, 0]
	  SrcBlock		  " SFunction "
	  SrcPort		  2
	  DstBlock		  "ig"
	  DstPort		  1
	}
	Line {
	  Name			  "x_clutch"
	  Labels		  [0, 0]
	  SrcBlock		  " SFunction "
	  SrcPort		  3
	  DstBlock		  "x_clutch"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      DiscretePulseGenerator
      Name		      "Pulse\nGenerator"
      Position		      [85, 38, 130, 72]
      PulseType		      "Time-based"
      Amplitude		      "1"
      Period		      "0.02"
      PulseWidth	      "50"
      PhaseDelay	      "0"
      SampleTime	      "1"
      VectorParams1D	      on
    }
    Block {
      BlockType		      Scope
      Name		      "Scope"
      Ports		      [2]
      Position		      [335, 88, 365, 137]
      Floating		      off
      Location		      [188, 365, 512, 604]
      Open		      off
      NumInputPorts	      "2"
      TickLabels	      "OneTimeTick"
      ZoomMode		      "on"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
	axes2			"%<SignalLabel>"
      }
      List {
	ListType		SelectedSignals
	axes1			""
	axes2			""
      }
      Grid		      "on"
      TimeRange		      "auto"
      YMin		      "-5~-5"
      YMax		      "5~15"
      SaveToWorkspace	      off
      SaveName		      "ScopeData"
      DataFormat	      "StructureWithTime"
      LimitDataPoints	      off
      MaxDataPoints	      "5000"
      Decimation	      "1"
      SampleInput	      on
      SampleTime	      "1/1000"
    }
    Line {
      SrcBlock		      "Chart"
      SrcPort		      1
      DstBlock		      "Scope"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Pulse\nGenerator"
      SrcPort		      1
      Points		      [110, 0]
      DstBlock		      "Chart"
      DstPort		      trigger
    }
    Line {
      SrcBlock		      "Chart"
      SrcPort		      2
      DstBlock		      "Scope"
      DstPort		      2
    }
  }
}

# Finite State Machines
# -- File save dated 21-Mar-2003 16:48:45
#
#    Stateflow Version 4.1 (R12.1) dated May 21 2001, 01:15:03
#
#

Stateflow {

	machine {
		id                   		1
		name                 		"temperal_test"
		created              		"21-Mar-2003 09:56:39"
		isLibrary            		0
		firstTarget          		15
		debug {
			disableAllBreakpoints		1
		}
		sfVersion            		41012101
	}

	chart {
		id                       		2
		name                     		"Chart"
		windowPosition           		[1.5 174 510.75 348.75]
		viewLimits               		[25.858 434.702 0 273.656]
		zoomFactor               		0.875
		screen                   		[1 1 1024 768 1.333333333333333]
		treeNode                 		[0 3 0 0]
		firstTransition          		7
		viewObj                  		2
		visible                  		1
		machine                  		1
		subviewS {
		}
		decomposition            		CLUSTER_CHART
		firstEvent               		9
		firstData                		10
		chartFileNumber          		1
	}

	state {
		id             		3
		labelString    		"heater_on"
		position       		[59.75 27.75 193 67.5]
		fontSize       		12
		chart          		2
		treeNode       		[2 0 0 4]
		subviewer      		2
		type           		OR_STATE
		decomposition  		CLUSTER_STATE
	}

	state {
		id             		4
		labelString    		"heater_off\n"
						"/x_clutch=0"
		position       		[244.25 138 90 60]
		fontSize       		12
		chart          		2
		treeNode       		[2 0 3 0]
		subviewer      		2
		type           		OR_STATE
		decomposition  		CLUSTER_STATE
	}

	transition {
		id             		5
		labelString    		"[x_clutch<=0]/ig=0;"
		labelPosition  		[73.764 154.219 105.487 15.712]
		fontSize       		12
		src {
			id          		3
			intersection		[3 0 1 0.8562 87.5 95.25 0 165.25]
		}
		dst {
			id          		4
			intersection		[4 -1 0 0.5042 244.25 167.75 0 -38.25]
		}
		midPoint       		[144.2384 154.473]
		chart          		2
		linkNode       		[2 6 8]
		dataLimits     		[87.5 244.25 95.25 170.15]
		subviewer      		2
		drawStyle      		SMART
		slide {
			sticky        		BOTH_STICK
		}
	}

	transition {
		id             		6
		labelString    		"after(100,CLK)/ig=1;x_clutch=6.5;"
		labelPosition  		[235.859 91.359 188.042 15.712]
		fontSize       		12
		src {
			id          		4
			intersection		[1 0 -1 0.4444 284.25 138 0 31.5]
		}
		dst {
			id          		3
			intersection		[2 1 0 0.5333 252.75 63.75 0 -31.5]
		}
		midPoint       		[282.2346 88.83]
		chart          		2
		linkNode       		[2 7 5]
		dataLimits     		[252.75 285.589 61.35 138]
		subviewer      		2
		drawStyle      		SMART
		slide {
			sticky        		BOTH_STICK
		}
	}

	transition {
		id             		7
		labelString    		"/x_clutch=6.5;"
		labelPosition  		[282.889 17.063 77.969 15.712]
		fontSize       		12
		src {
			intersection		[0 0.7071 0.7071 0 280.7338 7.0322 0 0]
		}
		dst {
			id          		3
			intersection		[2 1 0 0.2111 252.75 42 0 0]
		}
		midPoint       		[279.7007 29.435]
		chart          		2
		linkNode       		[2 0 6]
		dataLimits     		[252.75 283.719 7.032 44.4]
		subviewer      		2
	}

	transition {
		id             		8
		labelString    		"every(1,CLK)[x_clutch>0]/x_clutch=x_clutch-0.65;"
		labelPosition  		[58.014 107.625 273.873 15.712]
		fontSize       		12
		src {
			id          		3
			intersection		[3 0 1 0.6497 127.3579 95.25 0 0]
		}
		dst {
			id          		3
			intersection		[3 0 1 0.4593 164.1079 95.25 0 0]
		}
		midPoint       		[146.9305 108.6808]
		chart          		2
		linkNode       		[2 5 0]
		dataLimits     		[127.358 166.508 95.25 109.356]
		subviewer      		2
		slide {
		}
	}

	event {
		id         		9
		name       		"CLK"
		description		"the time base"
		linkNode   		[2 0 0]
		scope      		INPUT_EVENT
		trigger    		EITHER_EDGE_EVENT
		machine    		1
	}

	data {
		id               		10
		name             		"ig"
		linkNode         		[2 0 11]
		scope            		OUTPUT_DATA
		machine          		1
		dataType         		""
		props {
			range {
				minimum		""
				maximum		""
			}
		}
	}

	data {
		id               		11
		name             		"status"
		linkNode         		[2 10 12]
		scope            		LOCAL_DATA
		machine          		1
		dataType         		""
		props {
			range {
				minimum		""
				maximum		""
			}
		}
	}

	data {
		id               		12
		name             		"warm"
		linkNode         		[2 11 13]
		scope            		LOCAL_DATA
		machine          		1
		dataType         		""
		props {
			range {
				minimum		""
				maximum		""
			}
		}
	}

	data {
		id               		13
		name             		"x_clutch"
		linkNode         		[2 12 0]
		scope            		OUTPUT_DATA
		machine          		1
		dataType         		""
		props {
			range {
				minimum		""
				maximum		""
			}
		}
	}

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

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

⌨️ 快捷键说明

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