Finding start of increase of values in array.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michal Matowicki
le 11 Jan 2019
Commenté : Walter Roberson
le 12 Jan 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 commentaires
Réponse acceptée
Walter Roberson
le 11 Jan 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matched Filter and Ambiguity Function dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!