Fri 07 Sep 2012 11:40:44 AM UTC, original submission:
When the first 3 x,y,z arguments are not passed to interp3, it fails when using a method argument:
octave:1> interp3(ones([2,2,2]), 1:2,1:2,1:2,'nearest');
error: interpn: dimensional mismatch
error: called from:
error: /usr/local/share/octave/3.6.1-rc0/m/general/interpn.m at line 135, column 9
error: evaluating argument list element number 1
error: /usr/local/share/octave/3.6.1-rc0/m/general/interp3.m at line 105, column 8
octave:1> [x,y,z]=meshgrid( 1:2,1:2,1:2); interp3(ones([2,2,2]),x,y,z,'nearest');
error: interpn: wrong number or incorrectly formatted input arguments
error: called from:
error: /usr/local/share/octave/3.6.1-rc0/m/general/interpn.m at line 129, column 5
error: evaluating argument list element number 1
error: /usr/local/share/octave/3.6.1-rc0/m/general/interp3.m at line 105, column 8
This needs a one line fix in the code. I add a mercurial patch accordingly, where I've also added more test cases.
I've also changed the 1st test case to make it less symmetric. In the original version, it was using x=y which means it wasn't a very meaningful test to compare interp3 and interpn, and in fact its calling sequence was inaccurate.
Thanks
Kris
|