필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by