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

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

[Octave-bug-tracker] [bug #57964] polyfit() results for polynomial degre


From: José Luis García Pallero
Subject: [Octave-bug-tracker] [bug #57964] polyfit() results for polynomial degree greater or equal than number of data
Date: Fri, 6 Mar 2020 11:23:47 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

URL:
  <https://savannah.gnu.org/bugs/?57964>

                 Summary: polyfit() results for polynomial degree greater or
equal than number of data
                 Project: GNU Octave
            Submitted by: jgpallero
            Submitted on: vie 06 mar 2020 16:23:45 UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

Hello:

If I call polyfit as

polyfit(1,2,0)

I obtain the expected result of

ans =  2

But if I call the function with a polynomial degree greater than 0 I obtain a
vector of strange results

polyfit(1,2,3)
ans =

   0.50000   0.50000   0.50000   0.50000

while Matlab gives the correct solution (the problem is solved using the
correct maximum degree according to the data) plus a warning

>> polyfit(1,2,3)
Warning: Polynomial is not unique; degree >= number of data points. 
> In polyfit (line 70) 

ans =

     2     0     0     0


Is this Octave's behavior a bug or am I misunderstanding something?




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57964>

_______________________________________________
  Mensaje enviado vía Savannah
  https://savannah.gnu.org/




reply via email to

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