Effacer les filtres
Effacer les filtres

How do I record 2 peak values pass a specific number on the X axis?

2 vues (au cours des 30 derniers jours)
AJ516
AJ516 le 19 Juil 2017
Réponse apportée : Lipi le 19 Juil 2017
I attached a .fig file to help describe the data(PeakValues.fig, but if the attachment is missing, someone let me know.). Download the file to see the data.
There are three peaks recorded in the data above 4 on the Y-axis. However, I would like to record only the two peaks past 300 on the X-axis. I would like to record both x and y values of the two peaks and assign each x and y to a variable for finding the midpoint(ex. x1,y1 and x2,y2). What codes would be recommended to record the max values of two peaks if I only want the peaks pass 300?

Réponse acceptée

Lipi
Lipi le 19 Juil 2017
I understand that you want to record the peaks past 300. In that case you could limit your data to values past 300. For example if data is stored in variable called ‘data’, you could use something like:
[pks,locs] = findpeaks(data(300:end))
Where the 'pks' variable would contain your y1 and y2 values and 'locs' would have x1 and x2, which would record the max values of only two peaks.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by