Uniformly distributed vectors (pure quaternions)
Y = randv(varargin)
randv constructs uniformly distributed unit vectors (distributed uniformly in 3-space). It accepts the same parameters as the MATLAB® functions rand and randn.
Each unit vector returned is the result of two calls on the MATLAB® function rand, and hence randv modifies the state of the generator used by rand. To initialise the generator or control the choice of generator, use rand.
>> randv(2) ans = 2x2 pure quaternion array >> abs(ans) ans = 1.0000 1.0000 1.0000 1.0000