ck).'</span>)
0127 <span class="keyword">end</span>
0128 
0129 <span class="comment">% remove padding</span>
0130 <span class="keyword">if</span> length(Q)&gt;60
0131     Q_b(1:30) = [];
0132     Q_b(end-29:end) = [];
0133 <span class="keyword">else</span>
0134 <span class="keyword">end</span>
0135 
0136 <span class="comment">% calculate BFI</span>
0137 BFI = sum(Q_b,<span class="string">'omitnan'</span>)/sum(Q,<span class="string">'omitnan'</span>);
0138 
0139 <span class="comment">% check if 0&lt;=BFI&lt;