# ne, ~=

Determine whether real-world values of two arrays are not equal

## Syntax

``A ~= B``
``ne(A,B)``

## Description

example

````A ~= B` returns a logical array with elements set to logical `1` (`true`) where the real-world values of `A` and `B` are not equal, when `A` or `B` is a `fi` object. Otherwise, the element is logical `0` (`false`). The test compares both real and imaginary parts of numeric arrays.In relational operations comparing a floating-point value to a fixed-point value, the floating-point value is cast to a fixed-point type that preserves the relative order of the value with respect to the value in the fixed-point `fi` object.```

example

````ne(A,B)` is an alternate way to execute `A ~= B`, but is rarely used.```

## Examples

collapse all

Use the `ne` function to determine whether the real-world values of two `fi` objects are not equal.

```a = fi(pi); b = fi(pi, 1, 32); a ~= b```
```ans = logical 1 ```

Input `a` has a 16-bit word length, while input `b` has a 32-bit word length. The `ne` function returns `1` because after quantization, the value of `a` is greater than that of `b`.

When comparing a double to a `fi` object, the floating-point double is cast to a type that preserves the relative order of the value with respect to the value in the fixed-point `fi` object. This behavior allows relational operations to work between `fi` objects and floating-point constants without introducing floating-point values in generated code.

```a = fi(pi); b = pi; ne(a,b)```
```ans = logical 1```

## Input Arguments

collapse all

Operands, specified as scalars, vectors, matrices, or multidimensional arrays. Inputs `A` and `B` must either be the same size or have sizes that are compatible. For more information, see Compatible Array Sizes for Basic Operations.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `fi`
Complex Number Support: Yes

## Version History

Introduced before R2006a

expand all