Using diagonal matrix as index

John W. Eaton jwe at octave.org
Fri Jan 9 16:57:59 CST 2009


On  9-Jan-2009, Søren Hauberg wrote:

| Ohh, I see. I thought it would be the same as
| 
|   A (full (diag (true (1, 4)))) = 4
| 
| which produces an error with the current code. So, I guess the bug is
| that 'full' changes the class of diagonal matrices into 'double':
| 
|   octave:28> class (diag (true (1, 4)))
|   ans = logical
|   octave:29> class (full (diag (true (1, 4))))
|   ans = double
| 
| I would assume that the latter should have produced 'logical'.

Right, that's a bug.  It should not change the class.

jwe



More information about the Bug-octave mailing list