Access programmatically to EnumTypeDefinition in Simulink Data Dictionary

16 ビュー (過去 30 日間)
Giuseppe Rocca
Giuseppe Rocca 2021 年 2 月 26 日
コメント済み: Giuseppe Rocca 2021 年 2 月 26 日
I'm trying to programmatically access to an enumerative object in a Simulink Data Dictionary (Simple_dd.sldd) by means of the following instructions:
>> ddObject = Simulink.data.dictionary.open('Simple_dd.sldd');
>> ddSection = getSection(ddObject,'Design Data');
>> enumerationType = find(ddSection,'Name','EnumA');
>> getValue(enumerationType)
the result is a EnumTypeDefinition object, whose class provides only the methods "appendEnumeral" and "removeEnumeral".
How can I access to each label contained in EnumTypeDefinition object and convert them in a string?
Thanks,
Giuseppe

採用された回答

Fangjun Jiang
Fangjun Jiang 2021 年 2 月 26 日
out=getValue(enumerationType)
info=out.Enumerals
info.Name

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeManage Design Data についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by