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

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

[Octave-bug-tracker] [bug #32901] "diag" returns empty matrix where matl


From: anonymous
Subject: [Octave-bug-tracker] [bug #32901] "diag" returns empty matrix where matlab's diag returns [0]
Date: Mon, 28 Mar 2011 11:44:38 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.16) Gecko/20110319 SUSE/3.6.16-0.2.1 Firefox/3.6.16

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

> Are there any good reasons to adopt Matlab's behavior?
Well, I remember reading somewhere that every deviation from Matlab behavior
(besides extensions like #-comments, +=, etc..) is considered a bug in Octave.
 So valid Matlab code should run in Octave as well.

> It seems slightly bizarre that asking for the
> elements on the diagonal of an empty matrix
> should return anything other than the empty set.
Yes, but I'm not doing that.  The cited command asks for a zero matrix whos
first super-diagonal is empty.  Returning [0] here seems consistent to me:
For k=1,2,3...
+verbose+
diag(zeros(1,k),1)
-verbose-
returns
+verbose+
zeros(k+1)
-verbose-
hence it should also do so for k=0 (as Matlab does).


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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