detrend
Remove polynomial trend
Syntax
Description
y = detrend(
removes the best straight-fit line from the data inx
)x
.
If
x
is a vector, thendetrend
subtracts the trend from the elements ofx
.If
x
is a matrix, thendetrend
operates on each column separately, subtracting each trend from the corresponding column ofx
.
y = detrend(___,
specifies hownanflag
)NaN
values are treated for any of the previous syntaxes. For example,detrend(x,'omitnan')
removesNaN
值计算趋势之前,detrend(x,'includenan')
includes them (default).
y = detrend(___,
指定额外的参数rs using one or more name-value pairs. For example,Name,Value
)detrend(x,1,bp,'Continuous',false)
specifies that the fitted trend can have discontinuities.