Create Simulink.NumericType
object
describing unsigned fractional data type
a = ufrac(WordLength
) a = ufrac(WordLength
,GuardBits
)
ufrac(
returns
a WordLength
)Simulink.NumericType
object that describes the
data type of an unsigned fractional data type with a word size given
by WordLength
.
ufrac(
returns
a WordLength
, GuardBits
)Simulink.NumericType
object that describes the
data type of an unsigned fractional data type. The total word size
is given by
with WordLength
bits
located to the left of the binary point.GuardBits
Note
ufrac
is a legacy function. In new coder,
use fixdt
instead. In existing code, replace ufrac(WordLength)
with fixdt(0,WordLength,WordLength)
and ufrac(WordLength,GuardBits)
with fixdt(0,WordLength,(WordLength-GuardBits))
.
Define an 8-bit unsigned fractional data type with 4 guard bits. Note that the range of this data type is from 0 to (1 - 2-8).24 = 15.9375.
a = ufrac(8,4)
a = NumericType with properties: DataTypeMode: 'Fixed-point: binary point scaling' Signedness: 'Unsigned' WordLength: 8 FractionLength: 4 IsAlias: 0 DataScope: 'Auto' HeaderFile: '' Description: ''