Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Why is interp1(x,Y,...) being removed?
Posted:
Oct 16, 2012 10:40 AM


> Do you understand the latest version fully, Bruno? I can't test what it > really does...and so far I don't follow what the doc is trying to say. > > Is it indeed just terribly poorly written documentation or is there some > other functionality actually included now beyond that of simply > interpolation on the columns of the array Y?
I haven't actually tried more than 2 dimensions in Y, but I believe it will interpolate datasets in every dimension of Y provided the first dimension is the same length as x,
e.g.
x = linspace(0,2*pi,10)'; xi = [0,pi/4,pi]'; Y = sin(x); interp1(x, Y, xi)
ans =
0.0000e+000 685.5401e003 55.5112e018
Y = [sin(x), cos(x)];
interp1(x, Y, xi)
ans =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
Y(:,:,1:6) = repmat([sin(x), cos(x)], [1,1,6]);
interp1(x, Y, xi)
ans(:,:,1) =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
ans(:,:,2) =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
ans(:,:,3) =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
ans(:,:,4) =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
ans(:,:,5) =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
ans(:,:,6) =
0.0000e+000 1.0000e+000 685.5401e003 691.9949e003 55.5112e018 939.6926e003
and so on, which is really quite cool functionality as I can imagine arranging my data in a way that was physically meaningful for multiple degrees of freedom.



