octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35860] incorrect interp1 with array first arg


From: anonymous
Subject: [Octave-bug-tracker] [bug #35860] incorrect interp1 with array first argument
Date: Fri, 16 Mar 2012 06:22:05 +0000
User-agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)

URL:
  <http://savannah.gnu.org/bugs/?35860>

                 Summary: incorrect interp1 with array first argument
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 16 Mar 2012 06:22:04 UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: David
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.1
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Using interp1 in the following way
YI = interp1 (Y, XI)
with the default, linear interpolation,
gives an error when Y is an array (with more than one dimension).

Example:
========
octave:2> data=rand(3,2)
data =

   0.69133   0.95758
   0.34407   0.70075
   0.23343   0.35873

octave:3> interp1(data,[1 2 3])
error: interp1: quotient: nonconformant arguments (op1 is 2x2, op2 is 5x2)
error: evaluating argument list element number 1
error: called from:
error:   C:\Octave\Octave3.6.1_gcc4.6.2\share\octave\3.6.1\m\general\interp1.m
at line 213, column 11
=========
End of example.

I suppose there is an error in the interp1.m script,

  if (isempty (xi) && firstnumeric && ! ispp)
    xi = y;
    y = x;
    x = 1:numel(y);
  endif

should actually read

  if (isempty (xi) && firstnumeric && ! ispp)
    xi = y;
    y = x;
    x = 1:size(y,1);
  endif




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35860>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]