フィルターのクリア

Help reduce number of rows by grouping continous data

3 ビュー (過去 30 日間)
Youssif Youssif
Youssif Youssif 2022 年 11 月 29 日
回答済み: David Hill 2022 年 11 月 29 日
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

採用された回答

David Hill
David Hill 2022 年 11 月 29 日
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 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by