Interp3 Vector interpolation produces multidimensional array.

tolpingr at augsburg.edu tolpingr at augsburg.edu
Fri May 22 16:01:50 CDT 2009


 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
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090522/47bbafb9/attachment.html 


More information about the Bug-octave mailing list