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

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

[Octave-bug-tracker] [bug #47298] zeros() with empty dimensions but non


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #47298] zeros() with empty dimensions but non zero rows or columns does not fail
Date: Thu, 03 Mar 2016 14:50:29 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #2, bug #47298 (project octave):

For what it's worth:
Matlab R2012a does not fail on

zeros(zeros(1,0))


but it produces an empty matrix of size 0x0.
This seems to be the only case where you can pass empty matrices to zeros(),
ones(), Inf() or NaN() without provoking an error.

I am not sure whether this is an error in Matlab or whether its behaviour is
correct. After all, the documentation [1] states that the input argument sz is
the "Size of each dimension, specified as a row vector of integer values." You
could argue that a 1x0 vector was a row vector. Thus, a matrix with "no
dimensions" should be returned...

[1] https://de.mathworks.com/help/matlab/ref/zeros.html

The function nan() behaves the same as described in #comment 0 and is not
touched with your patch. Maybe you could fix it, too?

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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