fi
Determine whether fi object is signed
tf = issigned(a)
example
tf = issigned(a) returns 1 (true) if the fi object a is signed. Otherwise, it returns 0 (false).
a
1
true
0
false
collapse all
Create a fi object and determine whether it is signed or unsigned.
a1 = fi(pi,1)
a1 = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
tf = issigned(a1)
tf = logical 1
a2 = fi(pi,0)
a2 = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 16 FractionLength: 14
tf = issigned(a2)
tf = logical 0
If a numerictype object with Auto Signedness is used to create a fi object, the Signedness property of the fi object automatically defaults to Signed.
numerictype
Auto Signedness
Signedness
Signed
T = numerictype('Signedness','Auto')
T = DataTypeMode: Fixed-point: binary point scaling Signedness: Auto WordLength: 16 FractionLength: 15
a3 = fi(pi,T)
a3 = 1.0000 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 15
tf = issigned(a3)
Input fi object, specified as a scalar, vector, matrix, or multidimensional array.
Data Types: fi
isfi | isfixed | isscaleddouble | isscaledtype | isscalingbinarypoint | isscalingslopebias | isscalingunspecified
isfi
isfixed
isscaleddouble
isscaledtype
isscalingbinarypoint
isscalingslopebias
isscalingunspecified
You have a modified version of this example. Do you want to open this example with your edits?