Main Content

Apply moving window function to blocks of data

`[`

,
where `tA`

,`tB`

,...] = matlab.tall.movingWindow(`fcn`

,`window`

,`tX`

,`tY`

,...)`fcn`

is a function handle that returns multiple outputs, returns
arrays `tA,tB,...`

, each corresponding to one of the output arguments of
`fcn`

. The inputs to `fcn`

are windows of data from the
arguments `tX, tY, ...`

. This syntax has these requirements:

`fcn`

must return the same number of outputs as were requested from`matlab.tall.movingWindow`

.Each output of

`fcn`

must be the same type as the first data input`tX`

.All outputs

`tA,tB,...`

must have the same height.

`[___] = matlab.tall.movingWindow(___,`

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.