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

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

[Octave-bug-tracker] [bug #56659] Symmetry of linspace (-a, a, n)


From: Marco Caliari
Subject: [Octave-bug-tracker] [bug #56659] Symmetry of linspace (-a, a, n)
Date: Tue, 23 Jul 2019 07:25:19 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

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

                 Summary: Symmetry of linspace (-a, a, n)
                 Project: GNU Octave
            Submitted by: caliari
            Submitted on: Tue 23 Jul 2019 11:25:16 AM UTC
                Category: Octave Function
                Severity: 1 - Wish
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

If you generate a vector by


x = linspace (-1, 1, 11);


you discover that it is not symmetric


> x ==-fliplr (x)
ans =

  1  1  0  0  0  1  0  0  0  1  1


If you measure the difference you find


> max (abs (x + fliplr (x)))
ans =    2.2204e-16


(while it is eps/2 in matlab).
What about to correct by default the result by performing


x = (x - fliplr (x)) / 2;


at the end?




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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