You haven't clearly defined what consecutive values means mathematically. I'm assuming a difference of 1. Also you haven't explained if both columns are to be considered independently (and what happen if values are consecutive in one column and not the others). I'm assuming that both columns have the exact same pattern so we can ignore column 2 for finding consecutive values.
A=[100 200; 101 201; 102 202; 300 400; 801 901; 802 902]; %finding start and end of consecutive runs. Only using 1st column for that transitionrows = find(diff([-Inf; A(:, 1); +Inf]) ~= 1); %not consecutive when difference is not 1 startseqrows = transitionrows(1:end-1); %start row of consecutive run endseqrows = transitionrows(2:end) - 1; %end row of consecutive run B = [A(startseqrows, 1), A(endseqrows, 2)]
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.