Quaternion Function Reference

cumprod

Cumulative product
(Quaternion overloading of standard MATLAB® function)

Syntax

Y = cumprod(X, dim)

Description

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).

Examples

The cumulative product of a vector containing the three quaternion operators gives a vector with the three values qi, qk and -1:
>> 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

See Also

MATLAB® function: cumprod
QTFM functions: cumsum, prod, sum

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.