Quick 1-D linear interpolation
Note
interp1q
is not recommended. Use interp1
instead.
yi = interp1q(x,Y,xi)
yi = interp1q(x,Y,xi)
returns the value of
the 1-D function Y
at the points of column vector
xi
using linear interpolation. The vector x
specifies the coordinates of the underlying interval. The length of output
yi
is equal to the length of xi
.
For interp1q
to work properly,
x
must be a monotonically increasing column vector.
Y
must be a column vector or matrix with
length(x)
rows.
xi
must be a column vector
interp1q
returns NaN for any values of xi
that
lie outside the coordinates in x
. If Y
is a
matrix, then the interpolation is performed for each column of Y
, in
which case yi
is length(xi)-by-size(Y,2)
.