Fast peak finder returns 2xN array containing peak values and peak locations. End point maxima are not included.
Here is the file. Definitely leaves room for improvement. No H1 line, bare-bones help and no example. The use of the return variable is poor. The syntax should follow max() i.e.
maxima = zipeaks(y);
[maxima,ind] = zipeaks(y);
%Returns 2x(number of maxima) array
%peak(1,:) = value at maximum
%peakloc(2,:) = index value for maximum
%Find locations of local maxima
%yD=1 at maxima, yD=0 otherwise, end point maxima excluded
yD=[0 (sign(sign(y(2:N+1)-y(3:N+2))-sign(y(1:N)-y(2:N+1))-.1)+1) 0];
%Indices of maxima and corresponding values of y
Create scripts with code, output, and formatted text in a single executable document.