ega_en_n, gn_e(i-1,:)', dti);
    vel_e (i,:) = vel;

    <span class="comment">% Position update</span>
    pos = double(pos_update([lat_e(i-1) lon_e(i-1) h_e(i-1)], vel_e(i,:), dti));
    lat_e(i) = double(pos(1));
    lon_e(i) = double(pos(2));
    h_e(i)   = double(pos(3));

    <span class="comment">% Turn-rates update with both updated velocity and position</span>
    omega_ie_n = earth_rate(lat_e(i));
    omega_en_n = transport_rate(lat_e(i), vel_e(i,1), vel_e(i,2), h_e(i));

    <span class="comment