matlab ramp(et) syntax,Test Sequence and Assessment Syntax

本文档详细介绍了MATLAB语法如何在Test Sequence和Test Assessment块以及Stateflow图表中用于测试步骤操作、过渡和评估。内容涵盖评估语句、评估运算符、信号生成函数等,并提供了具体示例。
摘要由CSDN通过智能技术生成

Test Sequence and Assessment Syntax

This topic describes syntax used within Test Sequence and Test

Assessment blocks, and Stateflow® charts. In the blocks, you use this syntax for test step actions, transitions,

and assessments. In charts, you use this syntax in states and transitions.

For information on using the command-line interface to create and edit test sequence

steps, transitions, and data symbols, see the functions listed under Test

Sequences on the Test Scripts page.

Test Sequence and Test Assessment blocks use MATLAB® as the action language. You define actions, transitions, assessments with

assessment operators, temporal operators, transition operators, signal generation functions,

logical operators, and relational operators. Except for verify, Stateflow

charts can use all operators in MATLAB or C as the action language. verify can be used only with

MATLAB language. For example:

To output a square wave with a period of 10 sec:

square(et/10)

To transition when h changes to 0:

hasChangedTo(h,0)

To verify that x is greater than y:

verify(x > y)Assessment Statements

To verify simulation, stop simulation, and return verification

results, use assessment statements.

KeywordStatement

SyntaxDescriptionExampleverify(expression)

verify(expression,

errorMessage)

verify(expression, identifier,

errorMessage)Assesses a logical expression. Optional arguments label

results in the Test Manager and diagnostic viewer.verify(x > y,...

'SimulinkTest:'...

'greaterThan',...

'x and y values are '...

'%d, %d',x,y)

assert(expression)

assert(expression,

errorMessage)Evaluates a logical expression. Failure stops simulation

and returns an error. Optional arguments return an error message.assert(h==0 && k==0,...

'h an

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值