Effacer les filtres
Effacer les filtres

Help reduce number of rows by grouping continous data

3 vues (au cours des 30 derniers jours)
Youssif Youssif
Youssif Youssif le 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

Réponse acceptée

David Hill
David Hill le 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)]

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by