exist
类: coder.dictionary.Section
命名空间: coder.dictionary
语法
tf = exist(sectionObj,defName)
说明
如果由 sectionObj
表示的 Embedded Coder 字典分区包含名为 defName
的定义,则
返回 tf
= exist(sectionObj
,defName
)true
。
输入参数
sectionObj
— Embedded Coder 字典分区
coder.dictionary.Section
对象
Embedded Coder 字典中的分区,指定为 coder.dictionary.Section
对象。
defName
— Embedded Coder 字典定义的名称
字符向量 | 字符串标量
Embedded Coder 字典定义的名称,指定为字符向量或字符串标量。
示例: 'StorageClass2'
输出参量
tf
— true 或 false 结果
1
| 0
| 逻辑数组
true 或 false 结果,以 logical
数据类型的 1
或 0
形式返回。
示例
检查存储类是否存在
打开模型 RollAxisAutopilot
,并使用 coder.Dictionary
对象表示 Embedded Coder 字典。使用此对象可以访问字典的存储类分区,其中包含存储类定义。
openExample('RollAxisAutopilot') coderDictionary = coder.dictionary.open('RollAxisAutopilot');
创建一个 coder.dictionary.Section
对象,它表示 Embedded Coder 字典的存储类分区。
storageClassesSect = getSection(coderDictionary, 'StorageClasses');
检查存储类分区是否包含示例存储类 SignalStruct
。
exist(storageClassesSect,'SignalStruct')
ans = logical 1
删除该存储类,然后查看定义是否仍存在。
deleteEntry(storageClassesSect,'SignalStruct'); exist(storageClassesSect,'SignalStruct')
ans = logical 0
版本历史记录
在 R2019b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)