Cumulative product
(Quaternion overloading of standard MATLAB® function)
Y = cumprod(X, dim)
cumprod(X) computes the cumulative product of the quaternion argument. If the argument is a vector, the result is a vector. If the argument is a matrix, the cumulative product is computed along the columns by default. As with the equivalent MATLAB® function, the dim parameter permits the product to be computed along a specified dimension.
The ordering within the product is important, because of the non-commutative quaternion product: the product is computed with the lowest index on the left and the highest index on the right (that is, left to right for a row vector, or downwards for a column vector).
>> cumprod([qi, qj, qk]) ans = 1x3 quaternion array >> show(ans) ans.S = 0 0 -1 ans.X = 1 0 0 ans.Y = 0 0 0 ans.Z = 0 1 0