movmin
Moving minimum
Syntax
Description
M = movmin(
returns
an array of local A
,k
)k
-point centered minimum values,
where each minimum is calculated over a sliding window of length k
across
neighboring elements of A
. When k
is
odd, the window is centered about the element in the current position.
When k
is even, the window is centered about the
current and previous elements. The window size is automatically truncated
at the endpoints when there are not enough elements to fill the window.
When the window is truncated, the minimum is taken over only the elements
that fill the window. M
is the same size as A
.
If
A
is a vector, thenmovmin
operates along the length of the vectorA
.If
A
is a multidimensional array, thenmovmin
operates along the first dimension ofA
whose size does not equal 1.
M = movmin(___,
specifies the
dimension of dim
)A
to operate along for any of the previous syntaxes.
For example, if A
is a matrix, then
movmin(A,k,2)
operates along the columns of
A
, computing the k
-element sliding minimum
for each row.
M = movmin(___,
specifies
whether to omit or include nanflag
)NaN
values in A
.
For example, movmin(A,k,"includenan")
includes all
NaN
values when computing each minimum. By default,
movmin
omits NaN
values.
M = movmin(___,
specifies
additional parameters for the minimum using one or more name-value arguments. For
example, if Name,Value
)x
is a vector of time values, then
movmin(A,k,"SamplePoints",x)
computes the moving minimum
relative to the times in x
.