smooth
Smooth response data
Syntax
Description
smooths
the response data in column vector yy
= smooth(y
)y
using a moving average
filter.
The first few elements of yy
follow.
yy(1) = y(1) yy(2) = (y(1) + y(2) + y(3))/3 yy(3) = (y(1) + y(2) + y(3) + y(4) + y(5))/5 yy(4) = (y(2) + y(3) + y(4) + y(5) + y(6))/5 ...
smooth
handles endpoints, the result differs from the result
returned by the filter
function.Examples
Input Arguments
Output Arguments
Tips
You can generate a smooth fit to your data using a smoothing spline. For more information, see
fit
.
Alternative Functionality
You can also smooth data by using the MATLAB®
smoothdata
function. With the exception of GPU array support, smoothdata
includes all the functionality of the
smooth
function and has some advantages. Unlike
smooth
, the smoothdata
function supports:
Matrices, tables, and timetables
Moving median and Gaussian methods
Option to specify how the
NaN
values are treatedOption to substitute smoothed data for the original matrix or append smoothed data to the original matrix
Tall arrays, C/C++ code generation, and thread-based environments
Extended Capabilities
Version History
Introduced before R2006a