Interp3 Vector interpolation produces multidimensional array.

Jaroslav Hajek highegg at gmail.com
Mon May 25 00:57:13 CDT 2009


On Fri, May 22, 2009 at 11:01 PM,  <tolpingr at augsburg.edu> wrote:
> There is a  difference in the interpretation of the interp3 command for
> vector interpolation between Matlab 7.3.0 and Octave 3.0.1.
>
> Using the interp3 function in Matlab with vectors for X1, Y1, and Z1 creates
> a vector with values corresponding to the matched components of X1, Y1, and
> Z1. For some reason Octave does not duplicate  this functionality (which I
> believe is the correct functionality), but instead produces an array. A
> simple example is show in below:
>
> In Matlab:
>
>>> grid=ones(3,3,3);
>>> x1=linspace(1,3,5);
>>> y1=linspace(1,3,5);
>>> z1=linspace(1,3,5);
>>> interp3(grid,x1,y1,z1)
>
> ans =
>
>      1     1     1     1     1
>
> In Octave:
>
>>>
>
> octave:29> grid=ones(3,3,3);
> octave:30> x1=linspace(1,3,5);
> octave:31> y1=linspace(1,3,5);
> octave:32> z1=linspace(1,3,5);
> octave:33> interp3(grid,x1,y1,z1)
> ans =
>
> ans(:,:,1) =
>
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>
> ans(:,:,2) =
>
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>
> ans(:,:,3) =
>
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>
> ans(:,:,4) =
>
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>
> ans(:,:,5) =
>
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
>    1   1   1   1   1
> :
>
>
> I
>
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave
>
>

Seems fixed in current tip.

thanks

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



More information about the Bug-octave mailing list