You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: quat_rotate_better.m
    path of file: ./repos/hebi-matlab-examples/kits/igor/tools/kinematics
    
    the code of the file until where you have to start completion: function [ q_out ] = quat_rotate_better( w_x, w_y, w_z, q_bottom, dt )
%QUAT_ROTATE Rotate a quaternion by a velocity and timestep.
%
%   Details of the maths are from:
%   Sigma-Point Kalman Filters for Nonlinear Estimation and Sensor-Fusion
%   van der Merwe, Wan and Julier
    
    % Switch to scalar top, because that's what this code was written for
    q = zeros(4,1);
    q(1) =  q_bottom(4);   % w  -x
    q(2) = -q_bottom(1);   % x  -y  
    q(3) = -q_bottom(2);   % y  -z  
    q(4) = -q_bottom(3);   % z   w
    
%     q(1) = q_bottom(4);  % w 
%     q(2) = q_bottom(1);  % x   
%     q(3) = q_bottom(2);  % y 
%     q(4) = q_bottom(3);  % z

    
function [ q_out ] = quat_rotate_better( w_x, w_y, w_z, q_bottom, dt )
%QUAT_ROTATE Rotate a quaternion by a velocity and timestep.
%
%   Details of the maths are from:
%   Sigma-Point Kalman Filters for Nonlinear Estimation and Sensor-Fusion
%   van der Merwe, Wan and Julier
    
    % Switch to scalar top, because that's what this code was written for
    q = zeros(4,1);
    q(1) =  q_bottom(4);   % w  -x
    q(2) = -q_bottom(1);   % x  -y  
    q(3) = -q_bottom(2);   % y  -z  
    q(4) = -q_bottom(3);   % z   w
    
%     q(1) = q_bottom(4);  % w 
%     q(2) = q_bottom(1);  % x   
%     q(3) = q_bottom(2);  % y 
%     q(4) = q_bottom(3);  % z

    
    % Make the velocities into differential rotations
    d_x = w_x * dt;
    d_y = w_y * dt;
    d_z = w_z * dt;  

    % Construct 4 x 4 skew symmetric matrix
    Q_vel = [  0    d_x   d_y   d_z;
             -d_x    0   -d_z   d_y;
             -d_y   d_z    0   -d_x;
             -d_z  -d_y   d_x    0 ];
         
    % Norm of velocity vector for doing a cleaner quaternion update
    s = .5 * norm( [ d_x,  d_y,  d_z ] );
    
    if s==0
        s = 1E-6;
    end