pan>
0090         indTP = indTP + 1;
0091     <span class="keyword">end</span>
0092     ind5 = ind5 + 1;
0093 <span class="keyword">end</span>
0094 
0095 t_ind = [t_TP(1):t_TP(end)]';
0096 <span class="keyword">if</span> t_ind == 0
0097     t_ind = [1:length(Q)]';
0098     Q_b = NaN(size(Q));
0099 <span class="keyword">else</span>
0100     Q_b = interp1q(t_TP',TP',t_ind); <span class="comment">% linear interpolation</span>
0101     Qt = Q(t_ind);
0102     Q_b(Q_b&gt;Qt) = Qt(Q_b&gt;Qt); <span class="comment