Curve Fitting Toolbox    
excludedata

Specify data to be excluded from a fit

Syntax

Arguments

xdata
A column vector of predictor data.
ydata
A column vector of response data.
'MethodName'
The data exclusion method.
MethodValue
The value associated with MethodName.
outliers
A logical vector that defines data to be excluded from a fit.

Description

outliers = excludedata(xdata,ydata,'MethodName',MethodValue) identifies data to be excluded from a fit using the specified MethodName and MethodValue. outliers is a logical vector containing 1's marking data points to exclude while fitting, and 0's marking data points to include while fitting. The data exclusion methods are given below.

Method
Description
box
A four-element vector that specifies a box of data to include in a fit. Data outside the box is excluded. You specify the box as [xmin xmax ymin ymax].
domain
A two-element vector that specifies the domain of data to include in a fit. Data outside this domain is excluded. You specify the domain as [xmin xmax].
indices
A vector specifying the indices of the data points to be excluded.
range
A two-element vector that specifies the range of data to include in a fit. Data outside this range is excluded. You specify the range as [ymin ymax].

Remarks

You can combine data exclusion methods using logical operators. For example, to combine methods using the | (OR) operator

In some cases, you might want to use the ~ (NOT) operator to specify a box that contains all the data to exclude.

Example

Generate random data in the interval [0, 15], create a sine wave with noise, and add two outliers with the value 2.

Identify outliers that are outside the interval [-1.5, 1.5] using the range method.

Identify the same outliers using the indices method.

You can pass outliers to the fit function to exclude the specified data points from a fit.

See Also

fit


  disp feval