Thu 15 Jan 2015 02:42:44 PM UTC, comment #2:
It is not only a documentation error.
In Matlab, the default behavior is to extrapolate for values outside the range. Here is the Matlab result:
>> X=[0,0.5,1];Y=X;Z=X;
>> V=rand(3,3,3);
>> x=[-0.1,0,0.1]; y=x;z=x;
>> interp3(X,Y,Z,V,x,y,z,'spline')
ans =
0.2796 0.8147 0.8973
In Octave the last command would result in a NA for the first answer.
|
Thu 15 Jan 2015 12:19:26 PM UTC, comment #1:
Thank you for you bug report. It seems that "extrap" option should be a scalar value. That behavior is also consistent with MATLAB. It is clearly a documentation error and will be fixed with the next release.
So try:
Kai
|
Wed 14 Jan 2015 01:18:49 PM UTC, original submission:
The interp3 function searches for values in a pre-defined list. It has an option to extrapolate the values outside of this list (this is actually the default Matlab behaviour). However, when this option is used, an error is given.
Example:
>> X=[0,0.5,1]; Y=X; Z=X;
>> V=rand(3,3,3);
>> x=[-0.1,0,0.1]; y=x; z=x;
>> interp3(X,Y,Z,V,x,y,z,"spline")
ans =
NA
0.26611
0.26838
(In this case, the default Octave behaviour is to return an "NA" for every outlier. However, I would like to extrapolate the values via the "extrap" option).
>> interp3(X,Y,Z,V,x,y,z,"spline","extrap")
error: interp3: wrong number or incorrectly formatted input arguments
error: called from:
error: C:\Octave\Octave-3.8.2\share\octave\3.8.2\m\general\interp3.m a
t line 134, column 5
>>
Octave does not accept the "extrap" option in the interp3 function.
|