Main Content
shiftdata
Shift data to operate on specified dimension
Syntax
[x,perm,nshifts] = shiftdata(x,dim)
Description
[x,perm,nshifts] = shiftdata(x,dim)
shifts
data x
to permute dimension dim
to
the first column using the same permutation as the built-in filter
function.
The vector perm
returns the permutation vector
that is used.
If dim
is missing or empty, then the first
non-singleton dimension is shifted to the first column, and the number
of shifts is returned in nshifts
.
shiftdata
is meant to be used in tandem with unshiftdata
,
which shifts the data back to its original shape. These functions
are useful for creating functions that work along a certain dimension,
like filter
, goertzel
, sgolayfilt
,
and sosfilt
.
Examples
Version History
Introduced in R2008a