フィルターのクリア

How to recognize repetition in data for a certain period of time?

2 ビュー (過去 30 日間)
Jacqueline
Jacqueline 2013 年 7 月 3 日
Hi, first off I am very new to Matlab. I asked a similar question yesterday but I don't think I was specific enough so I'm going to try again...
I am analyzing data that comes from a truck, such as engine speed, vehicle speed, etc. The data is collected randomly throughout the day for about 3 hours (10,000 seconds). I am trying to write a script that will detect any repetition in the data that last for 60 seconds or more. Because if that happens, there is something wrong with the sensors in the truck.
For example, if for engine speed I had 10,000 points ranging from 0-2100, and for 60 seconds in a row the data was stuck on 1,000, how would I write a script to detect this and say there is an error?
I appreciate any help I can get! Thanks

回答 (2 件)

dpb
dpb 2013 年 7 月 3 日
Use diff() on the responses and look for zeros in consecutive locations.
How to determine the time is dependent on how it is recorded; you don't give enough info to tell.

Jan
Jan 2013 年 7 月 4 日
You can use FEX: RunLength to get the number of repetitions:
x = randi(5, 1, 1000);
[value, repetition, index] = RunLength(x);
sticky = find(repetitions > 60);

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by