Documentation

isequivalent

Determine if two numerictype objects have equivalent properties

Syntax

y = isequivalent (T1, T2)

Description

example

y = isequivalent (T1, T2) determines whether the numerictype object inputs have equivalent properties and returns a logical 1 (true) or 0 (false). Two numerictype objects are equivalent if they describe the same data type.

Examples

collapse all

Use isequivalent to determine if two numerictype objects have the same data type.

T1 = numerictype(1, 16, 2^-12, 0)
T1 =


          DataTypeMode: Fixed-point: slope and bias scaling
            Signedness: Signed
            WordLength: 16
                 Slope: 2^-12
                  Bias: 0
T2 = numerictype(1, 16, 12)
T2 =


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 12
isequivalent(T1,T2)
ans =

  logical

   1

Although the Data Type Mode is different for T1 and T2, the function returns 1 (true) because the two objects have the same data type.

Input Arguments

collapse all

Inputs to be compared, specified as numerictype objects.

See Also

| |

Introduced in R2014a

Was this topic helpful?