">% Gravity update</span>
    gn_e(i,:) = gravity(lat_e(i), h_e(i));

    <span class="comment">% Attitude update</span>
    [qua, DCMbn, euler] = att_update(wb_corrected, DCMbn, qua, <span class="keyword">...</span>
        omega_ie_n, omega_en_n, dti, att_mode);
    roll_e(i) = euler(1);
    pitch_e(i)= euler(2);
    yaw_e(i)  = euler(3);
</pre>
<h2 id="10">ZUPT DETECTION ALGORITHM</h2>
<pre class="codeinput">    idz = floor( vor_dme.zupt_win / dti ); <span class="comment">% Index to set ZUPT window time<