MATLAB COMPILER RELEASE NOTES User's Guide Page 222

  • Download
  • Add to my manuals
  • Print
  • Page
    / 716
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 221
R2012a
7-12
Functionality What Happens
When You
Use This
Functionality
Use This Instead Compatibility Considerations
interp1(X, Y, Xq,
[], ...) where []
specifies the default
interpolation method
Still Runs interp1(X, Y, Xq,
'linear', ...)
Replace all instances
of interp1(X, Y,
Xq, [], ...) with
interp1(X, Y, Xq,
'linear', ...).
interp1(x,V,..)
where x is a vector
and V is an array
representing multiple
value sets. For
example:
x = (1:5)';
V = [x, 2*x, 3*x];
xq = (1:0.5:5)';
Vq = interp1(x, V, xq);
Still Runs Use griddedInterpolant
and loop over each value set,
updating and evaluating
during each iteration.
Replace all instances of
interp1(x,V,...),
where x is a vector and V
is an array representing
multiple value sets.
Loop over V, calling
griddedInterpolant
on each value set. The
following example code
shows how to set up and
interpolate over three value
sets in V :
x = (1:5)';
V = [x, 2*x, 3*x];
xq = (1:0.5:5)';
F =
griddedInterpolant(x,
V(:,1));
for n=1:3
F.Values = V(:, n);
Vq(:, n) = F(xq);
end
The columns of Vq are the
interpolation results for the
corresponding columns of V.
Page view 221
1 2 ... 217 218 219 220 221 222 223 224 225 226 227 ... 715 716

Comments to this Manuals

No comments