Skip to content

isequal

Test whether two or more inputs are equal in shape and value.

tf = isequal(A, B)
tf = isequal(A, B, C, ...)

Returns scalar true when every input has the same dimensions and the same element values, false otherwise. With more than two arguments, all arguments must be pairwise equal.

NaN values are not equal to themselves under isequal — use isequalwithequalnans for the NaN-tolerant variant.

isequal([1 2 3], [1 2 3]) % 1
isequal([1 2], [1 2 3]) % 0
isequal(1, 1.0, 1) % 1
isequal(NaN, NaN) % 0