+ Plus
(Quaternion and octonion overloadings of standard MATLAB® function)
Y = A + B
This function implements the elementwise binary addition operator for quaternion arrays. It is implemented for both full and pure quaternions and will implicitly supply a zero scalar part when needed. It also will work where one of the operands is not a quaternion, for example to add a real or complex value to a quaternion (implicitly to the scalar part).
The left and right parameters must have components of the same class, or if one is numeric, it must have the same class as the components of the other (which must be a quaternion). It is not possible, for example, to add a matrix of uint8 unsigned integers to a pure quaternion matrix with components of type double. This is to prevent the creation of a quaternion matrix with components of mixed class, which would cause problems in other functions.
>> 1 + qi + qj + qk ans = 1 + 1 * I + 1 * J + 1 * K