Create peakdet2.m

find peaks (maxima and minima) of functions