A=[0 1 2 5 7 8 13 17 28 11 6 0 2 1 4 14 18 0 2 16 15 18 13 0 ] % added a passing and failing block above threshold
Adiff = diff(A>12);
ind_start = find(Adiff==1);
ind_stop = find(Adiff==-1);
block_length = ind_stop-ind_start; % list of consecutive section lengths
blocks_ind = find(block_length>2)% list of blocks above min length
for ii = 1:numel(blocks_ind) % loops through each block
A(ind_start(blocks_ind(ii))+1:ind_stop(blocks_ind(ii)))
end
0 Comments
Sign in to comment.