MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
读取 Test Sequence 模块符号属性
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol)
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol,Property)
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol) 返回 symbolInfo 指定的 Test Sequence 模块中 symbol 的属性结构 blockPath。
symbolInfo
blockPath
symbol
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol,Property) 返回 symbolInfo 的 Property 的值 symbol。
Property
全部折叠
此示例编辑 Test Sequence 模块中的常量 DurationLimit,将其更改为 single 数据类型的局部变量。
DurationLimit
single
1.加载模型。
Model = 'sltestRollRefTestExample'; load_system(Model)
2.搜索包含单词 duration 的数据符号。
duration
data_names = sltest.testsequence.findSymbol... ('sltestRollRefTestExample/Test Sequence','Name','[Dd]uration',... 'RegExp','on','Kind','Data')
data_names = 1×1 cell array {'DurationLimit'}
3.读取 DurationLimit 常量的属性。
dlProperties = sltest.testsequence.readSymbol... ('sltestRollRefTestExample/Test Sequence',data_names{1})
dlProperties = struct with fields: Kind: 'Data' Scope: 'Constant' DataType: 'double' Description: '' Document: '' InitialValue: '5' Name: 'DurationLimit' Size: '' Tag: []
4.将 DurationLimit 更改为 single 数据类型的局部变量。
sltest.testsequence.editSymbol('sltestRollRefTestExample/Test Sequence',... data_names{1},'Scope','Local','DataType','single')
5.关闭模型。
close_system(Model,0)
Test Sequence 模块的路径,包括模块名称,指定为字符串或字符向量。您可以使用模块句柄,而不是模块路径。
示例: 'FanSpeedTestHarness/Test Sequence'
'FanSpeedTestHarness/Test Sequence'
Test Sequence 模块符号名称,指定为字符向量。符号包括用作 Test Sequence 模块中的输入、输出、局部变量、常量、参数或数据存储内存的数据、消息、函数调用和触发器。
示例: 'DurationLimit'
'DurationLimit'
Test Sequence 模块符号属性,指定为字符向量。要找到特定符号的有效属性,请使用 sltest.testsequence.readSymbol(blockPath,symbol) 读取该符号的属性。
sltest.testsequence.readSymbol(blockPath,symbol)
示例: 'Kind'
'Kind'
示例: 'Scope'
'Scope'
示例: 'DataType''Description'
'DataType'
'Description'
Test Sequence 模块符号的属性。
示例: struct
struct
在 R2017a 中推出
sltest.testsequence.addSymbol | sltest.testsequence.deleteSymbol | sltest.testsequence.findSymbol | sltest.testsequence.readStep | sltest.testsequence.readTransition
sltest.testsequence.addSymbol
sltest.testsequence.deleteSymbol
sltest.testsequence.findSymbol
sltest.testsequence.readStep
sltest.testsequence.readTransition
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处