On Jan 30, 1:45=A0pm, "Shaddy " <s.shokrallaREMOVET...@gmail.com> wrote:
> All,
>
> I'm looking for a very fast way find the true/false vector of all local m=
inima for a vector of finite length
>
> This is what I have so far:
>
> for a column vector of real numbers, 'v'. =A0The true/false vector storin=
g locations of all local minima 'a' is
>
> a=3D[false; (v(2:end1)<v(3:end)) & (v(2:end1)<v(1:end2)); false];
>
> Is there a faster way out there for large vectors v in Matlab?
>
> Thanks,
=

Shaddy:
Do you have the Image Processing Toolkit? You could use the erosion
function, which basically is a rank filter that returns a vector or
image that has at each pixel the minimum value of the original image
in a user defined window, such as a 3 by 3 window or a 5 by 5 window
or a 1 by 3 window (for vectors). The opposite, dilation, is a rank
filter on the max end (finds local maxima) and the median filter is a
rank filter than is half way up.
Regards,
ImageAnalyst
