subtract#

AnsMath.subtract(obj1, obj2)#

Subtract two AnsMath vectors or matrices.

Parameters:
obj1AnsVec or AnsMat

AnsMath object.

obj2AnsVec or AnsMat

AnsMath object.

Returns:
AnsVec or AnsMat

Difference of the two input vectors or matrices. The type of the output matches the type of the input.

Examples

Subtract two AnsMath vectors.

>>> v = mm.ones(10)
>>> w = mm.ones(10)
>>> x = mm.subtract(v, w)