Quaternion Function Reference

diff

Differences
(Quaternion overloading of standard MATLAB® function)

Syntax

Z = diff(X, n, dim)

Description

diff(X, n, dim) computes the n-th differences between elements of the quaternion array X along dimension dim, if specified.

Examples

>> A = randq(1,2)
 
A = 1x2 quaternion array
 
>> show(A)
 
A.S = -0.3782    0.0448

A.X = -0.2545    0.1962

A.Y = -0.7229   -0.3947

A.Z =  0.5192    0.8965

>> diff(A)
 
ans = 0.423 + 0.4507 * I + 0.3282 * J + 0.3773 * K

See Also

MATLAB® function: diff
QTFM functions: prod, sum

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

License terms.