isequal
Test whether two or more inputs are equal in shape and value.
Syntax
Section titled “Syntax”tf = isequal(A, B)tf = isequal(A, B, C, ...)Description
Section titled “Description”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.
Examples
Section titled “Examples”isequal([1 2 3], [1 2 3]) % 1isequal([1 2], [1 2 3]) % 0isequal(1, 1.0, 1) % 1isequal(NaN, NaN) % 0See also
Section titled “See also”isequalwithequalnans— Likeisequal, but treatsNaNs as equal to otherNaNs.size_equal— Test whether all inputs share the same shape.