How to recognize repetition in data for a certain period of time?
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
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.
0 个评论
Jan
2013-7-4
x = randi(5, 1, 1000);
[value, repetition, index] = RunLength(x);
sticky = find(repetitions > 60);
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!