Filter löschen
Filter löschen

Help reduce number of rows by grouping continous data

3 Ansichten (letzte 30 Tage)
Youssif Youssif
Youssif Youssif am 29 Nov. 2022
Beantwortet: David Hill am 29 Nov. 2022
Hello,
as seen in the attached image, does anyone know how I can reduce the number of rows by grouping the first and last number of data that are squential. Ex) the first cell should say 20390-20400 because thats the first and last point in which continous data by differnce of 1 is present. the second row should say 22579-22588, then third row should say 25895-25904.
Thanks

Akzeptierte Antwort

David Hill
David Hill am 29 Nov. 2022
d=find(diff(yourData)>1);
m=[yourData(1),yourData(d(1))];
for k=2:length(d)
m(k,:)=[yourData(d(k-1)+1),yourData(d(k))];%generate matrix with beginning to end of each stream
end
m(end+1,:)=[yourData(d(end)+1),yourData(end)]

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by