Main Content

issigned

Determine whether fi object is signed

Description

tf = issigned(a) returns 1 (true) if the fi object a is signed. Otherwise, it returns 0 (false).

example

Examples

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.

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)
tf = logical
   1

Input Arguments

collapse all

Input fi object, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: fi

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.

Version History

Introduced before R2006a