User`s guide

R2013a
5-12
Mathematics
scatteredInterpolant and griddedInterpolant support for
extrapolation
scatteredInterpolant is a new class for interpolating scattered data, and it returns
extrapolated values by default when you evaluate at query points outside the convex
hull.
griddedInterpolant now returns extrapolated values by default when you evaluate at
query points outside the domain of your sample grid.
Compatibility Considerations
scatteredInterpolant supports extrapolation by default. This behavior is different
from that of TriScatteredInterp, which returns NaN when you evaluate at query
points outside the convex hull using the 'linear' or 'natural' methods. To preserve
the TriScatteredInterp behavior, set the ExtrapolationMethod property to
'none'. See the scatteredInterpolant reference page for more information.
griddedInterpolant previously returned NaN values when you queried points
outside the domain of the sample points using the 'linear', 'cubic' or 'nearest'
interpolation methods. Now all interpolation methods support extrapolation by
default. To preserve the old behavior, set the ExtrapolationMethod property to
'none' when the interpolation method is 'linear', 'cubic' or 'nearest'. See the
griddedInterpolant reference page for more information.
Syntax for ones, zeros, and other functions for creating arrays that
match attributes of an existing variable
The functions ones, zeros, eye, Inf, NaN, true, false, and cast now can return an output
that matches the data type, sparsity, and complexity (real or complex) of a variable p.
For example:
p = uint8([1 2]);
X = ones(2,3,'like',p);
class(X)