[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #32901] "diag" returns empty matrix where matl
[Octave-bug-tracker] [bug #32901] "diag" returns empty matrix where matlab's diag returns 
Mon, 28 Mar 2011 22:42:13 +0000
Mozilla/5.0 (X11; U; Linux i686; de; rv:18.104.22.168) Gecko/20110303 SUSE/3.6.15-0.2.1 Firefox/3.6.15
Follow-up Comment #4, bug #32901 (project octave):
> What is the Matlab behavior for the following...
for all k=0,2,3,4,5,..., and
I don't think this is inconsistent.
Matlab sees ones(k,0) as a _matrix_, not as a _vector_,
so in this case, it really tries to extract the second super-diagonal and
hence yields .
On the other hand, ones(1,0) has only one singleton
dimension (0 being non-singleton), so it's a vector by definition, and diag
switches to the create-a-matrix-mode.
> we are open-source numerical computing software which is
> generally compatible with Matlab, but we don't follow
> them slavishly where it doesn't appear to make sense
I see. I can only speak from a pure user's viewpoint here. At the moment,
this incompatibility forces me to include another
if-exists(OCTAVE_VERSION)-switch in my code. But finally, it's up to the
developers to balance the reasons.
Reply to this item at:
Nachricht geschickt von/durch Savannah