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

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

[Octave-bug-tracker] [bug #51246] pinv(0) different from Matlab


From: Rik
Subject: [Octave-bug-tracker] [bug #51246] pinv(0) different from Matlab
Date: Fri, 3 Nov 2017 11:29:27 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #14, bug #51246 (project octave):

@Michael: Thanks.  I've got a cset that addresses this issue.  I know it is a
corner case, but I'm actually not pleased that Octave has been returning the
wrong answer for zero vectors and scalars for many years.

A final test to run through Matlab for diagonal matrices


D = diag ([0 0 0])
pinv (D)


In Octave, this creates a special Diagonal matrix and the result is


octave:4> D = diag ([0 0 0])
D =

Diagonal Matrix

   0   0   0
   0   0   0
   0   0   0

octave:5> pinv (D)
ans =

Diagonal Matrix

   0   0   0
   0   0   0
   0   0   0



But if I use full matrices, I get NaN


octave:6> D = full (diag ([0 0 0]))
D =

   0   0   0
   0   0   0
   0   0   0

octave:7> pinv (D)
ans =

   NaN   NaN   NaN
   NaN   NaN   NaN
   NaN   NaN   NaN



So what does Matlab do?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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