The various quaternion functions in the Aerospace Toolbox (see http://www.mathworks.com/help/aerotbx/flight-parameters-1.html) all indicate that an input quaternion q should have "its scalar number as the first column" (i.e., [w x y z] ordering rather than [x y z w]). However, this convention doesn't always seem to produce the expected result.
If MATLAB's quatrotate function is used to perform this rotation, the result is quatrotate([1/sqrt(2) 0 0 1/sqrt(2)], [1 1 1]) = [1 -1 1] This result corresponds to a rotation about the z axis by -90 degrees, not 90 as expected.
Another example: rotating [0 0 1] by the quaternion [1/sqrt(2) 1/sqrt(2) 0 0] (which represents a 90 degree rotation about the x axis) yields quatrotate([1/sqrt(2) 1/sqrt(2) 0 0],[0 0 1]) = [0 1 0] when the expected result is [0 -1 0].
The result from quatrotate (at least for these two examples) seems to be determined using a left-handed coordinate system, yet the documentation for the Aerospace Toolbox explicitly states that "[t]he Aerospace Toolbox software uses right-handed (RH) Cartesian coordinate systems" (see http://www.mathworks.com/help/aerotbx/ug/defining-coordinate-systems.html#bqsgj4j-5). Other quaternion functions exhibit similar behaviour (e.g., using the quaternion from the first example, quat2dcm produces a matrix that performs a -90 degree rotation about the z axis).
Have I missed a part of the documentation that explains this behaviour, or am I using these functions incorrectly? Any assistance would be appreciated.