Access programmatically to EnumTypeDefinition in Simulink Data Dictionary

5 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 26 Fév 2021
out=getValue(enumerationType)
info=out.Enumerals
info.Name

Plus de réponses (0)

Catégories

En savoir plus sur Manage Design Data dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by