Timeseries events - how to extract y values for each event
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rebecca Harding
le 18 Mar 2021
Commenté : Rebecca Harding
le 19 Mar 2021
Hello,
I have plotted a timeseries for some behavioural data and I would like to extract all of the scores (on the y axis) for the times in the events that I have entered. Please could someone help point me in the right direction
Thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/555057/image.png)
2 commentaires
Adam Danz
le 18 Mar 2021
I assume the red dots are the times you entered. If so, how did you plot them without using the (x,y) coordinates? I seems that you already have the y-data if you plotted the red dots and the red dots are the times you entered.
Réponse acceptée
David Hill
le 18 Mar 2021
I am assuming you have two arrays, t and y, of the same length. To get the y values corresponding to an array of input times, T, then:
y_values=y(ismember(t,T));
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Time Series Events dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!