How can I change the maker for the 'findpeaks' function?

2 views (last 30 days)
Is there any way to change the blue inverted triangle generated by the 'findpeaks' function to a red inverted triangle?

Accepted Answer

Ameer Hamza
Ameer Hamza on 26 Apr 2020
Edited: Ameer Hamza on 26 Apr 2020
From the documentation, it seems that findpeaks does not directly support changing marker. You will need to do it in two steps. First, find the height and location of peaks and then use plot() to draw create the peaks according to your own specifications. See this example: https://www.mathworks.com/help/releases/R2020a/signal/ref/findpeaks.html#burmuhq
Something like this
x % x-value of signal
y % y-values of signal
[pk, loc] = findpeaks(y, x);
plot(x,y,'-', loc, pk, 'vr')

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!