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

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

[Octave-bug-tracker] [bug #46103] inversion of a singular diagonal matri


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #46103] inversion of a singular diagonal matrix A produces inv(A)==A
Date: Fri, 02 Oct 2015 13:12:58 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1

Follow-up Comment #1, bug #46103 (project octave):

Thanks for your bug report. This does not appear to be documented, but when
inverting a singular diagonal matrix, the original matrix is returned.

As you've noticed, and as the documentation for inv() clearly states, there
are often better ways to solve the problem using mldivide, or pinv.

Also, if you like this answer better,


octave:1> inv(diag(0:2))
warning: matrix singular to machine precision, rcond = 1
ans =

Diagonal Matrix

   0   0   0
   0   1   0
   0   0   2

octave:2> inv(full(diag(0:2)))
warning: matrix singular to machine precision
ans =

   Inf   Inf   Inf
   Inf   Inf   Inf
   Inf   Inf   Inf



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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