function av = helperQuat2AV(q, dt)
%This function is for example use only. It may be removed in the future. 
%HELPERQUAT2AV Convert quaternion sequence to angular velocity in the body frame
%   AV=HELPERQUAT2AV(Q,DT) converts the N-by-1 vector Q into an N-by-3 array of
%   angular velocities in the body frame. The angular velocity AV is in
%   units of rad/s. DT is the time (in seconds) between successive
%   quaternion samples in Q.

%   Copyright 2018 The MathWorks, Inc.   


% Computes angular velocity in the body frame from a sequence of
% quaternions

    validateattributes(q, {'quaternion'}, {'finite', 'column', ...
        'nonempty'});

    validateattributes(dt, {'double', 'single'}, {'finite', 'real', ...
        'nonempty', 'scalar'});
    
    av4 = compact( (2* conj(q(1:end-1)) .* q(2:end))./dt);
    av = av4(:,2:end);
