How do I record 2 peak values pass a specific number on the X axis?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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?
0 Commenti
Risposta accettata
Lipi
il 19 Lug 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.
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!