Display "fixdt" data type in Simulink format
Show older comments
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!
Accepted Answer
More Answers (1)
Alexander Carmeli
on 13 Jun 2023
Edited: Alexander Carmeli
on 13 Jun 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)
Categories
Find more on String in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!