How to find a peak in data?

1 view (last 30 days)
anthony
anthony on 12 Feb 2012
Hello My name is Anthony, I am a high school student working on a software to analyze solar flare data and autonomously find there peaks. My friend told me that I can take the derivative of each data point and see where it is undefined. Does any one know how to do this i have tried diff()?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 12 Feb 2012
or
data = randi(179,30,1);% eg your data
d1 = [true;diff(data)>0]
out = data(strfind(d1(:).',[1,0]))

More Answers (0)

Community Treasure Hunt

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

Start Hunting!