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

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

[Octave-bug-tracker] [bug #38151] Empty length in a linspace


From: Marco Caliari
Subject: [Octave-bug-tracker] [bug #38151] Empty length in a linspace
Date: Wed, 23 Jan 2013 14:04:48 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0

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

                 Summary: Empty length in a linspace
                 Project: GNU Octave
            Submitted by: caliari
            Submitted on: Wed 23 Jan 2013 02:04:47 PM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Dear maintainers,

what should be the result of


linspace(0,1,[])


Actually (3.6.2), it is an error. If I consider the following case


v = 1:4;
idx = find (v > 2);
linspace (min (idx), max (idx), length (idx))
linspace (min (idx), max (idx), max (idx) - min (idx) + 1);


the last two lines give the same result [3,4]. But if I consider
the same example with


idx = find (v > 4); % idx = [](1x0)


the second last line works (although giving the transposed result [](0x1)) and
the last line does not work. 
If I do the same in Matlab, I get [](1x0) and error, respectively.
I do not know what "should" be the result and, of course, it is a corner
case.

Marco 




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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