bug in argument processing of interpn (and documentation error)
David Bateman
David.Bateman at motorola.com
Thu Sep 18 03:15:20 CDT 2008
Kris Thielemans wrote:
> Hi
>
> I find that the extrapval optional argument of interpn is ignored (at least
> in version 3.0.1). Example:
>
> octave.exe:175> interpn([1,2],[1,2],[1,2;3,4],1,3,'linear',5)
> ans = NA
>
> This can be easily fixed by modifying the argument processing by inserting 1
> line in interpn.m (marked with "KT fix" below):
>
> % start quote from line 77
> elseif (ischar (varargin{end - 1}))
> if (! isnumeric (varargin{end}) || ! isscalar (varargin{end}))
> error ("extrapal is expected to be a numeric scalar");
> endif
> method = varargin{end - 1};
> extrapval = varargin{end}; %%%%%%% KT fix %%%%%%%%%%%%%%%%%
> nargs = nargs - 2;
> endif
>
> Also, the documentation of interpn mentions that extrapval can be the string
> 'extrap', but that is not implement (and neither is it in matlab, so I am
> guessing this is a copy-paste mistake from interp1).
>
> Thanks
>
>
Ok, this seems correct. Here is the fix as a changeset credited to you.
D.
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch8536
Url: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20080918/ac7813b6/attachment.ksh
More information about the Bug-octave
mailing list