Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

Simulink 模型中将需求正式化

使用 Requirements Table 模块在仿真之前和仿真期间计算逻辑

通过使用 Requirements Table 模块在运行前和运行时计算逻辑,在 Simulink® 模型中定义正式需求。使用正式需求来检查您的模型的输出或执行模块输出。

直接在该模块、需求编辑器中或使用 MATLAB® 中的编程命令配置正式需求。

模块

Requirements TableModel formal requirements with input conditions (自 R2022a 起)

函数

全部展开

slreq.modeling.createCreate new model with Requirements Table block (自 R2022a 起)
slreq.modeling.findFind Requirements Table blocks (自 R2022a 起)
slreq.loadLoad requirement set or link set

对象

全部展开

RequirementsTableConfigure Requirements Table blocks (自 R2022a 起)
SymbolConfigure data in Requirements Table blocks (自 R2022a 起)
RequirementRowRequirements in Requirements Table block (自 R2022a 起)
AssumptionRowAssumptions in Requirements Table block (自 R2022a 起)

对象函数

全部展开

管理模块数据

addSymbolAdd data to Requirements Table block
findSymbolRetrieve data in Requirements Table block

管理模块行

addAssumptionRowAdd assumption to Requirements Table block
addRequirementRowAdd requirement to Requirements Table block
addChildAdd child requirement or assumption to Requirements Table block
getRequirementRowsRetrieve requirements in Requirements Table block
getAssumptionRowsRetrieve assumptions in Requirements Table block
getChildrenRetrieve child requirements and assumptions in Requirements Table block
slreq.getCurrentObjectGet selected objects in Requirements Editor, Requirements Browser, or Requirements Table block
clearClear row in Requirements Table block
removeRowRemove Requirements Table block row

管理模块列

hideAssumptionColumnHide Precondition column in Assumptions tab
hideRequirementColumnHide columns in Requirements tab
showAssumptionColumnShow Precondition column in Assumptions tab
showRequirementColumnShow columns in Requirements tab

运算符

全部展开

时序逻辑

durationTime during which condition is valid in Requirements Table block
getPreviousPrevious value of data in Requirements Table block
isStartupWhether simulation time is 0 in Requirements Table block
tElapsed time of simulation in Requirements Table block

更改检测

hasChangedDetect change in data since last time step in Requirements Table block
hasChangedFromDetect change in data from specified value in Requirements Table block
hasChangedToDetect change in data to specified value in Requirements Table block

创建、串联和转换字符串

str2doubleConvert string to double-precision value in Requirements Table block
stringConvert value to string in Requirements Table block
plusConcatenate strings in Requirements Table block

确定字符串的属性

isletterDetermine which characters are letters in Requirements Table block
isspaceDetermine which characters are spaces in Requirements Table block
isstringDetermine if input is string in Requirements Table block
strlengthDetermine length of string in Requirements Table block
containsDetermine if string contains substring in Requirements Table block

查找和替换字符串字符

containsDetermine if string contains substring in Requirements Table block
endsWithDetermine if string ends with substring in Requirements Table block
matchesDetermine if two strings match in Requirements Table block
replaceFind and replace substrings in Requirements Table block
replaceBetweenReplace substrings between start and end points in Requirements Table block
startsWithDetermine if string starts with substring in Requirements Table block
strfindFind substring within a string in Requirements Table block
strrepFind and replace substrings in Requirements Table block

编辑字符串

eraseDelete substrings within strings in Requirements Table block
eraseBetweenDelete substring between start and end points in Requirements Table block
extractAfterExtract substring after position in Requirements Table block
extractBeforeExtract substring before position in Requirements Table block
insertAfterInsert string after substring in Requirements Table block
insertBeforeInsert string before substring in Requirements Table block
lowerConvert string to lowercase in Requirements Table block
upperConvert a string to uppercase in Requirements Table block
reverseReverse order of characters in strings in Requirements Table block
stripRemove leading and trailing characters from string in Requirements Table block
strtrimRemove leading and trailing white space from string in Requirements Table block

比较字符串

matchesDetermine if two strings match in Requirements Table block
strcmpCompare strings in Requirements Table block (case sensitive)
strcmpiCompare strings in Requirements Table block (case insensitive)
strncmpCompare first N characters of strings in Requirements Table block (case sensitive)
strncmpiCompare first N characters of strings in Requirements Table block (case insensitive)

主题

创建和管理需求

配置需求数据

测试具有需求的模型

疑难解答

Identify Inconsistent and Incomplete Formal Requirement Sets

Use Simulink Design Verifier™ to find inconsistent and incomplete requirement sets. (自 R2022a 起)

Debug Requirements Table Blocks

Debug Requirements Table block requirements during simulation. (自 R2023a 起)