Apply moving window function and block reduction to padded blocks of data
applies tA
= matlab.tall.blockMovingWindow(windowfcn
,blockfcn
,window
,tX
)blockfcn
to complete windows of data and
windowfcn
to incomplete windows of data near the edges.
window
specifies the size of the sliding window. The result contains
the vertical concatenation of applying blockfcn
and
windowfcn
to these windows of data.
[
,
where tA
,tB
,...] = matlab.tall.blockMovingWindow(windowfcn
,blockfcn
,window
,tX
,tY
,...)windowfcn
and blockfcn
are function handles that
return multiple outputs, returns arrays tA, tB, ...
, each corresponding
to one of the output arguments of windowfcn
and
blockfcn
. The inputs to windowfcn
and
blockfcn
are pieces of data from the arguments tX, tY,
...
. This syntax has these requirements:
windowfcn
and blockfcn
must return the same
number of outputs as were requested from
matlab.tall.blockMovingWindow
.
Each output of windowfcn
and blockfcn
must
be the same type as the first data input tX
.
All outputs tA,tB,...
must have the same height.
[___] = matlab.tall.blockMovingWindow(___,
specifies additional options with one or more name-value pair arguments using any of the
previous syntaxes. For example, to adjust the step size between windows, you can specify
Name,Value
)'Stride'
and a scalar. Or to change the treatment of endpoints where
there are not enough elements to complete a window, you can specify
'EndPoints'
and a valid option ('shrink'
,
'discard'
, or a numeric padding value).
Use matlab.tall.movingWindow
for simple sliding-window calculations.
matlab.tall.blockMovingWindow
is an advanced API designed to
provide more flexibility to perform sliding-window calculations on tall arrays. As such, it
is more complicated to use since the functions must accurately process blocks of data that
contain many complete windows. However, with properly vectorized calculations, you can
reduce the necessary number of function calls and improve performance.