Help CenterHelp Center
fi
Unsigned decimal representation of stored integer of fi object
b = dec(a)
example
b = dec(a) returns the stored integer of fi object a in unsigned decimal format as a character vector.
b
a
Fixed-point numbers can be represented as
real-world value=2−fraction length×stored integer
or, equivalently as
real-world value=(slope×stored integer)+bias
The stored integer is the raw binary number, in which the binary point is assumed to be at the far right of the word.
collapse all
Create a signed fi object with values -1 and 1, a word length of 8 bits, and a fraction length of 7 bits.
-1
1
a = fi([-1 1], 1, 8, 7)
a = -1.0000 0.9922 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 8 FractionLength: 7
Find the unsigned decimal representation of the stored integers of fi object a.
b = '128 127'
Input array, specified as a fi object.
Data Types: fi
bin | hex | storedInteger | oct | sdec | dec2hex | dec2base | dec2bin
bin
hex
storedInteger
oct
sdec
dec2hex
dec2base
dec2bin
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office