How can i display a list of maximum of a curve ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Mallouli Marwa
am 14 Dez. 2016
Bearbeitet: Antonio Aguirre
am 14 Dez. 2016
Hi
I have a curve Amplitude=f(frequency) and i want to know the abscissa of all maximums.
Please help me.
0 Kommentare
Akzeptierte Antwort
Antonio Aguirre
am 14 Dez. 2016
Bearbeitet: Antonio Aguirre
am 14 Dez. 2016
Try looking up the findpeaks() function.
https://www.mathworks.com/help/signal/ug/find-peaks-in-data.html
Seems to take in a curve and find the peaks and output the location of those 'n' # of peaks.
your code should look something like this:
________________________________________
frequency = some matrix of frequencies;
Amplitude=f(frequency);
[pks, locs] = findpeaks(Amplitude);
%if you want to see it is true
plot(frequency,Amplitude,frequency(locs),pks)
________________________________________________
Your abscissa's that you are looking for would be essentially frequency(locs), where locs is the index number in the matrix 'frequency' that contains your independent variable (called frequency or x or abscissa) corresponding to your peaks.
Let me know if you have any questions.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!