how to draw a peak line
Show older comments

Hi, i've data and i want to draw a line that corresponds to the peaks (where there is a zero the previous value >0 must be pasted) (See black line painted)
Is there a function or graph type that does this to me?
Accepted Answer
More Answers (1)
Walter Roberson
on 29 Sep 2024
mask = islocalmaximum(YourSignal);
peak_times = YourSignalTimes(mask);
peak_values = YourSignal(mask);
plot(peak_times, peak_values);
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
