Test for pure quaternion
Y = ispure(X)
ispure(X) returns logical 1 (true) if the quaternion array X is pure.
Mathematically, a pure quaternion has zero scalar part. Here, pure quaternions are stored without a scalar part, and it is the existence of the scalar part which is tested by this function, not its value. Thus a quaternion with a scalar part with value zero is not pure according to the definition used by this function. Similarly, empty quaternions do not have a scalar part (or any part) and therefore this function regards them as pure.
The reason for implementing pure quaternions in the way described is for efficiency: reduced storage, and reduced computation, since computation with pure quaternions can be done without wasting time computing with the zero scalar part.