detecting no. of events
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
Thorsten
2015 年 11 月 5 日
編集済み: Thorsten
2015 年 11 月 5 日
If D contains an entry every second, you can use:
D = randi(2000, 1, 20); % sample data
di = diff([0 D > 25 0]);
i1 = find(di == 1);
i2 = find(di == -1);
Nevents = nnz(i2 - i1 > 20);
3 件のコメント
Thorsten
2015 年 11 月 5 日
What's the size of D? If it is 20000x1 as you said in your original post, then it should work. If it is 1x20000, you have to use
di = diff([0; D > 25; 0]);
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!