ecreasing_flow(1:end-1) ~= decreasing_flow(2:end));
0102 <span class="comment">% reshape into x by 2 array (columns = start, end of decrease)</span>
0103 flow_change = flow_change(1:(2*floor(size(flow_change,1)./2)));
0104 flow_change = reshape(flow_change,2,[]).';
0105 <span class="comment">% find sections</span>
0106 flow_section = flow_change((flow_change(:,2)-flow_change(:,1))&gt;=len_decrease+n_start,:);
0107 flow_section = flow_section+start_point;
0108 flow_section(:,1) = flow_section(:,1)+n_start; <