X, Y, Z components of a quaternion
r = x(q), r = y(q), r = z(q)
These three functions extract the three components of the vector part of a quaternion. The result is a real (or a complex value if the quaternion has complex components).
>> q = quaternion(1, 2, 3, 4) q = +1 +2 I +3 J +4 K >> y(q) ans = 3 >> q = randq(2) q = 2x2 quaternion array >> x(q) ans = -0.2900 -0.1664 0.2511 -0.2816