Finding start of increase of values in array.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Michal Matowicki
el 11 de En. de 2019
Comentada: Walter Roberson
el 12 de En. de 2019
Hello everyone,
I am sorry if the title was not clear anought. I have an matrix of 104 collumns (arrays) and n rows (~3000).
Array represent a recorded speed of vehicle from the driving simulator, before and after passing the speed limit sign. I need to find a place when vehicle started and finished speed change.

The problem is, that their speed is not constant before and after but rather slightly oscilates around initial speed and than aroun final speed, thus normal findpeaks, or diff function. My idea is, to find a moment when values of speed increase/decrease for 10 consequtive times in the row, but i have no idea how to code it.
Can you please help me with my task? Or maybe you know better idea how to make it?
I attach picture of my data, and example of the file.
In file:
distance=data (:,3)
speed=data(:,9)
Speed sign is always in the middle of distance.
Thanks in advance for your help
0 comentarios
Respuesta aceptada
Walter Roberson
el 11 de En. de 2019
mask=diff(speed).'>0;
strfind([0,mask], [0, ones(1,10)])
putting 0 at the beginning of the mask is to catch the case where the speed up is the very first thing in the array .
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!