2014-08-12 22:36:45 +02:00

1.1 KiB

Function deepEqual

Test element wise whether two matrices are equal. The function accepts both matrices and scalar values.

Syntax

math.deepEqual(x, y)

Parameters

Parameter Type Description
x Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null First matrix to compare
y Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null Second matrix to compare

Returns

Type Description
Number | BigNumber | Complex | Unit | Array | Matrix Returns true when the input matrices have the same size and each of their elements is equal.

Examples

math.deepEqual(2, 4);   // returns false

a = [2, 5, 1];
b = [2, 7, 1];

math.deepEqual(a, b);   // returns false
math.equal(a, b);       // returns [true, false, true]

See also

equal, unequal