Display "fixdt" data type in Simulink format
古いコメントを表示
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!
採用された回答
その他の回答 (1 件)
Alexander Carmeli
2023 年 6 月 13 日
編集済み: Alexander Carmeli
2023 年 6 月 13 日
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)
カテゴリ
ヘルプ センター および File Exchange で String についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!