Quick search for local extremes
The new function extr.m analyses the given real vector carrying a sequence of samples to be analyzed. At the end, it returns a cell array of extreme positions in the sequence. The cell array consists of two cells only. The first one contains the logical vector of maxima and the other the similar one of minima. Should more equal values be present in adjacent elements of the vector, only one position is returned. The attention is also paid on low memory requirements and a speed of the procedure.
Forms of calls:
L = extr(x); % Find true local extremes
% ..... x vector containing a sequence to be analyzed,
% ..... L cell array {L(1), L(2)}, where
% ..... L(1) is logical vector of positions of maxima,
% ..... L(2) is logical vector of positions of minima.
There are also circumstances, when the processing time is critical for a user, while the exact t