Display "fixdt" data type in Simulink format
Afficher commentaires plus anciens
Hi!
Is there is way to convert a data type information from 'fixdt(1,16,0)' format to the compiled Simulink data type format?
'fixdt(1,16,0)' --> 'int16'
fixdt(0,16,-5)' --> 'ufix16_E5'
'fixdt(1,5,12)' --> 'sfix5_En12'
I would like to get a simulink.parameter variable data type in this form.

Thanks!
Réponse acceptée
Plus de réponses (1)
Alexander Carmeli
le 13 Juin 2023
Modifié(e) : Alexander Carmeli
le 13 Juin 2023
The tostringInternalSlName() method does exactly that:
fixdt(1, 16, 0).tostringInternalSlName
fixdt(0, 16, -5).tostringInternalSlName
fixdt(1, 5, 12).tostringInternalSlName
You can find it on embedded.numerictype, and it works on Simulink.NumericType (what fixdt() produces) too.
methods(embedded.numerictype)
Catégories
En savoir plus sur String dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!