I would like to convert data of double type to single type before code generation in 2020A Simulink, without using Cast blocks on most functions.

조회 수: 1 (최근 30일)
I would like to do this without using Cast blocks on most functions.
  댓글 수: 1
Scott McNeil
Scott McNeil 2023년 3월 7일
And what is the best way to build a model from the beginning in a smaller data type like uint16 wihout using many Cast blocks and Converters?

댓글을 달려면 로그인하십시오.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2023년 3월 7일
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2023년 3월 7일
The code generated after running set_param(gcs, 'DataTypeOverride', 'Single') shows using real32_T, which is float (single).
Scott McNeil
Scott McNeil 2023년 3월 8일
Thank you Fangjun Jiang. This was very helpful to get our model into Single Floating point which was very helpful to the Software coding process. I have also learned that changing to Fixed point types requires much more involvement during the code generating process. Some of the tools shared in the article were very good to learn.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by