Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Why is interp1(x,Y,...) being removed?
Replies: 55   Last Post: Oct 16, 2012 5:10 PM

 Messages: [ Previous | Next ]
 Richard Crozier Posts: 117 Registered: 3/19/09
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.5401e-003
55.5112e-018

Y = [sin(x), cos(x)];

interp1(x, Y, xi)

ans =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

Y(:,:,1:6) = repmat([sin(x), cos(x)], [1,1,6]);

interp1(x, Y, xi)

ans(:,:,1) =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

ans(:,:,2) =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

ans(:,:,3) =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

ans(:,:,4) =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

ans(:,:,5) =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

ans(:,:,6) =

0.0000e+000 1.0000e+000
685.5401e-003 691.9949e-003
55.5112e-018 -939.6926e-003

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.

Date Subject Author
10/10/12 Richard Crozier
10/10/12 Matt J
10/10/12 Richard Crozier
10/11/12 dpb
10/11/12 Matt J
10/11/12 Richard Crozier
10/11/12 dpb
10/11/12 Matt J
10/10/12 dpb
10/10/12 Bruno Luong
10/10/12 james bejon
10/10/12 Richard Crozier
10/10/12 Derek Goring
10/12/12 Penny Anderson
10/12/12 Matt J
10/12/12 james bejon
10/12/12 dpb
10/12/12 dpb
10/12/12 Steven Lord
10/12/12 dpb
10/12/12 dpb
10/13/12 Bruno Luong
10/13/12 Matt J
10/13/12 Bruno Luong
10/13/12 Matt J
10/13/12 Bruno Luong
10/15/12 Steven Lord
10/15/12 dpb
10/15/12 dpb
10/15/12 dpb
10/16/12 Bruno Luong
10/16/12 dpb
10/16/12 Richard Crozier
10/16/12 dpb
10/16/12 Bruno Luong
10/16/12 dpb
10/16/12 Richard Crozier
10/16/12 dpb
10/13/12 dpb
10/11/12 dpb
10/12/12 Penny Anderson
10/12/12 dpb
10/15/12 Steven Lord
10/15/12 Richard Crozier
10/15/12 Steve Eddins
10/15/12 Steven Lord
10/15/12 Richard Crozier
10/15/12 Steve Eddins
10/15/12 Bruno Luong
10/15/12 dpb
10/15/12 Ken Garrard
10/15/12 dpb
10/15/12 dpb
10/12/12 Bruno Luong
10/13/12 Richard Crozier
10/12/12 Mark Shore