smoothdata
Smooth noisy data
Syntax
Description
smooths entries of B
= smoothdata(A
)A
using a moving average.
smoothdata
determines the moving window size from the
entries in A
. The window slides down the length of the
vector, computing an average over the elements within each window.
If
A
is a matrix, thensmoothdata
computes the moving average down each column ofA
.If
A
is a multidimensional array, thensmoothdata
operates along the first dimension ofA
whose size does not equal 1.If
A
is a table or timetable with numeric variables, thensmoothdata
operates on each variable ofA
separately.
specifies additional parameters for smoothing using one or more name-value
arguments. For example, if B
= smoothdata(___,Name,Value
)t
is a vector of time values, then
smoothdata(A,"SamplePoints",t)
smooths the data in
A
relative to the times in t
.
[
also returns the moving window size.B
,winsize
]
= smoothdata(___)
Alternative
You can use smoothdata
functionality interactively by
adding the Smooth
Data task to a live script.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
More About
Algorithms
When the window size for the smoothing method is not specified, smoothdata
computes
a default window size based on a heuristic. For a smoothing factor τ,
the heuristic estimates a moving average window size that attenuates
approximately 100*τ percent of the energy of the input data.
Extended Capabilities
Version History
Introduced in R2017aSee Also
Functions
smoothdata2
|fillmissing
|fillmissing2
|movmean
|movmedian
|movmad
|filter