How is a parameter's data type determined when it is set to "inherit via internal rule" in Simulink 7.4 (R2009b)?

조회 수: 21 (최근 30일)
I have a simple Gain block attached to an input port. I notice that the data type of the Gain parameter is set to "inherit via internal rule"
When I pass an integer to a Gain block with a Gain value of '1.1' Simulink generates the following warning:
Warning: Parameter precision loss occurred for 'Gain'. The parameter's value cannot be represented exactly using the run-time data type. A
small quantization error has occurred. You can control this diagnostic on the Diagnostics pane of the Configuration Parameters dialog. This
originated from 'untitled/Gain'.
Thus I would like to know how the data type of the Gain parameter is determined.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 4월 22일
편집: MathWorks Support Team 2019년 4월 22일
The internal rule decides the data type of the Gain parameter based on the input signal's word-length and sign, and attempts to maximize the precision. In this particular case, the input data type is Integer and therefore a precision-loss warning is generated.
To work around this, you will need to manually specify the data type of the Gain parameter. To do this, open the Gain block's mask dialog and click on the Parameter Attributes pane. In the drop-down menu that appears, select the appropriate data type for the Gain parameter.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2009b

Community Treasure Hunt

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

Start Hunting!

Translated by