what is this type "sfix16_Sp1_Bn25"

조회 수: 10 (최근 30일)
dayoung
dayoung 2024년 9월 30일
편집: Andy Bartlett 2024년 10월 1일
What is
"sfix16_Sp1_Bn25" this type mean for?

답변 (2개)

Manish
Manish 2024년 9월 30일
Hi dayoung,
Here is the breakdown of the data type:
  • sfix: Signed Fixed-Point data type.
  • S: slope
  • P: Decimal point
  • B: Bias
  • n: Negative
Therefore, "sfix16_Sp1_Bn25" describes a signed 16-bit fixed-point number with a slope of 0.1 and a bias of -25.
Here is the documentation link:
Hope it helps!

Andy Bartlett
Andy Bartlett 2024년 10월 1일
편집: Andy Bartlett 2024년 10월 1일
Tip: Feed Simulink Type Name to numerictype
If the type name corresponds to a numeric type (not a Bus, Enum, Alias, or user custom type), then feed the string to numerictype to get a numerictype object that explains the details.
nt1 = numerictype("sfix16_Sp1_Bn25")
nt1 = DataTypeMode: Fixed-point: slope and bias scaling Signedness: Signed WordLength: 16 Slope: 0.1 Bias: -25
nt2 = numerictype("ufix7_En5")
nt2 = DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 7 FractionLength: 5
nt3 = numerictype('single')
nt3 = DataTypeMode: Single
Tip 2: fixed.extractNumericType can also be used and is more general
fixed.extractNumericType can convert many inputs to its numerictype object. See it's help for more info.
nt4 = fixed.extractNumericType('half')
nt4 = DataTypeMode: Half
nt5 = fixed.extractNumericType("flts8_E6")
nt5 = DataTypeMode: Scaled double: binary point scaling Signedness: Signed WordLength: 8 FractionLength: -6
Tip 3: fixdt also works except for scaled doubles
nt6 = fixdt('sfix123_S4_B5')
nt6 =
NumericType with properties: DataTypeMode: 'Fixed-point: slope and bias scaling' Signedness: 'Signed' WordLength: 123 Slope: 4 Bias: 5 IsAlias: 0 DataScope: 'Auto' HeaderFile: '' Description: ''

카테고리

Help CenterFile Exchange에서 Fixed Point에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by