Skip to content

eq

Element-wise equality test (function form of ==).

C = eq(A, B)

Returns a logical array where each element is true if A(i) == B(i). NaN values are unequal to themselves.

eq([1 2 3], [1 0 3]) % [1 0 1]
  • ne — Element-wise inequality test (function form of ~=).
  • isequal — Test whether two or more inputs are equal in shape and value.
  • equalwithequalnans — Element-wise equality with NaN treated as equal to NaN.