add#

AnsMath.add(obj1, obj2)#

Add two AnsMath vectors or matrices.

Parameters:
obj1AnsVec or AnsMat

AnsMath object.

obj2AnsVec or AnsMat

AnsMath object.

Returns:
AnsVec or AnsMat

Sum of the two input objects. The type of the output matches the type of the input.

Examples

Add two AnsMath vectors.

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