Main Content




  • 在测试用例中使用时间和逻辑评估。

  • Test AssessmentTest Sequence 模块中包含 verify 语句以及其他运算符。使用 Test Sequence 模块指定一系列步骤来仿真在测组件或在测系统。使用 Test Assessment 模块来评估在测组件或在测系统的行为。

  • 使用 Model Verification 库中的模块。


  • 将测试输出与基线数据进行比较,或使用等效性准则比较两个仿真的输出。

  • 比较仿真数据与基线数据或比较两个仿真时使用值或时间容差。可用的容差类型包括相对容差、绝对容差、超前容差和滞后容差。超前容差和滞后容差对于数据时序不同的比较(例如不同求解器之间的比较)或者桌面上运行的模型与目标上运行的代码之间的比较非常有用。

  • 使用自定义准则脚本处理仿真数据。

有关不同验证方法的概述,请参阅Assess Simulation and Compare Output Data


Observer ReferenceCreate and contain an Observer model
Observer PortWirelessly link signals to use with verification
Test SequenceCreate simulation testing scenarios, function calls, and assessments
Test AssessmentAssess and verify behavior of system under test
Sequence ViewerDisplay messages, events, states, transitions, and functions between blocks during simulation

sltest.testmanager.AssessmentLogical or temporal assessment object (自 R2022a 起)
sltest.testmanager.AssessmentSymbolSymbol used in assessment (自 R2022a 起)
sltest.testmanager.TestCaseCreate or modify test case


Simulink 测试管理器Model and code testing in different execution environments, manage test suites, and analyze and report results



verifyAssess logical expression and automatically log result
assertEvaluate logical expression and stop simulation if false
etElapsed time of test step
tElapsed time of simulation
afterElapsed time since beginning of test step
beforeElapsed time until specified time in test step
durationElapsed time since condition is true
hasChangedDetect data change in test step
hasChangedFromDetect data change from specified value in test step
hasChangedToDetect data change to specified value in test step
squareSquare wave test signal
sawtoothSawtooth wave test signal
triangleTriangle wave test signal
rampReturn input value for test signal generation
heavisideHeaviside step test signal
latchSave value of an expression