Why am I getting "double" datatype automatically for every simulink block?

조회 수: 30 (최근 30일)
Kaustubh
Kaustubh 2024년 5월 14일
편집: Walter Roberson 2025년 9월 13일
Upon making minor changes in the simulink model, the simulink blocks are automatically being assigned with the datatype double. Since all the blocks having this datatype, the "DatatypeOverride = Off" option as well as locking the output datatype option are not working. Is it possibly because of the introduction of switch-case block or something else? Kindly help me out.
Thank you.
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2024년 5월 16일
The default datatype in MATLAB and Simulink is double. Was it showing something different before making "minor changes"? Were you able to restore and show the data type other than all doubles?
Sanghyo Jeong
Sanghyo Jeong 2024년 7월 2일
편집: Sanghyo Jeong 2024년 7월 2일
I am also getting every variables as double. Casting block doesn't work and affect on any signals.

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

답변 (2개)

MathWorks Fixed Point Team
MathWorks Fixed Point Team 2025년 9월 12일
편집: Walter Roberson 2025년 9월 13일
Data Type Override setting on the model or selected subsystem is the likely culpit for this behavior.
Use get_param API's to query the current setting.
get_param('MyModel', 'DataTypeOverride')
Update the setting using set_param:
set_param('MyModel', 'DataTypeOverride', 'Double')
See how to interact with these model and subsystem settings at:

Divyanshu
Divyanshu 2024년 8월 1일
편집: Divyanshu 2024년 8월 1일
Hi Kaustubh,
A possible reason that it shows 'double' datatype for all the blocks after adding a 'Switch' block can be the value of parameter 'Output data type' under 'Signal Attributes' tab of block parameters.
If the value is 'Inherit: Inherit via internal rule' then due to attribute propagation it shows 'double' for all the blocks.
This propagation creates an internal loop in the model. To break this loop you can add one or more Signal Specification block.
You can also refer the following MATLAB answer thread which addresses a similar issue:
Hope it helps!

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by