How can I change the maker for the 'findpeaks' function?
2 views (last 30 days)
Show older comments
Emily McCarty
on 26 Apr 2020
Commented: Ameer Hamza
on 26 Apr 2020
Is there any way to change the blue inverted triangle generated by the 'findpeaks' function to a red inverted triangle?
0 Comments
Accepted Answer
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')
2 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!