n = quatnormalize(q)
n = quatnormalize(q) calculates the normalized quaternion, n, for a given quaternion, q. Input q is an m-by-4 matrix containing m quaternions. n returns an m-by-4 matrix of normalized quaternions. Each element of q must be a real number. Additionally, q has its scalar number as the first column.
The quaternion has the form of
The normalized quaternion has the form of
 Stevens, Brian L., Frank L. Lewis, Aircraft Control and Simulation, Wiley–Interscience, 2nd Edition.