This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Return total slope of scaling of registered data type


extern double ssGetDataTypeTotalSlope (SimStruct *S, DTypeId



SimStruct representing an S-function block.


Data type ID of the registered data type for which you want to know the total slope.


Fixed-point numbers can be represented as

real-world value = (slope × integer) + bias,

where the slope can be expressed as

slope = fractional slope × 2exponent.

This function returns the total slope, rather than the fractional slope, of the data type designated by dataTypeId. To get the fractional slope, use ssGetDataTypeFracSlope:

  • If the registered data type has trivial scaling, including double and single data types, the function returns a total slope of 1.

  • If the registered data type is ScaledDouble, the function returns the total slope of the nonoverridden data type. Refer to the examples below.

This function errors out when ssGetDataTypeIsFxpFltApiCompat returns FALSE.


To use this function, you must include fixedpoint.h and fixedpoint.c. For more information, see Structure of the S-Function.




The data type sfix32_En4 becomes flts32_En4 with data type override. The total slope returned by this function in either case is 0.0625 (2-4).

The data type ufix16_s7p98 becomes fltu16_s7p98 with data type override. The total slope returned by this function in either case is 7.98.

TLC Functions


Introduced before R2006a

Was this topic helpful?