Help reduce number of rows by grouping continous data
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Youssif Youssif
il 29 Nov 2022
Risposto: David Hill
il 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
0 Commenti
Risposta accettata
David Hill
il 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)]
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!