Differences
(Quaternion overloading of standard MATLAB® function)
Z = diff(X, n, dim)
diff(X, n, dim) computes the n-th differences between elements of the quaternion array X along dimension dim, if specified.
>> 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