finding specific distance on a plot
Afficher commentaires plus anciens

I am trying to find the time it takes on the plot to go from its peak to 40 percent (or any other distance) of the way(downward). the y-axis is the data and x-axis is the time. the picture is just a sample and a random plot and it is not the real one because I have not got it yet. I know I should use findpeaks first to get the location and value of the peak but to find the minima, I only want the one which is after the peak not before as it is shown in the picture
Réponses (1)
Ameer Hamza
le 20 Mai 2018
Modifié(e) : Ameer Hamza
le 20 Mai 2018
If x-axis values id t and y-axis values is y then you can find the required time using
[maxVal maxIndex] = max(y);
index = y < 0.4*maxVal;
fortyPercentIndex = find(index(maxIndex:end), 1);
Time = t(maxIndex+fortyPercentIndex-1) - t(maxIndex)
This approach the values of the signal occurring before the peak value and find the 40% point which occurs after the peak.
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!