Hi, Playing with the new diag() function in octave 3.1.52 I can see some extrange behaviour (or I don't understand some particular cases). For example, for the matrix a = diag([2 3 4])
This is a diagonal matrix: typeinfo(a) -> diagonal matrix
But if I add a scalar: typeinfo(4+a) -> matrix If I multiply by a scalar: typeinfo(4*a) -> diagonal matrix But if I multiply by a scalar in element-by-element form: typeinfo(4.*a) -> matrix If I divide by a scalar in element-by-element form: typeinfo(4./a) -> matrix
For a power operation: typeinfo(a^2) -> diagonal matrix But element-by-element: typeinfo(a.^2) -> matrix For functions: typeinfo(sqrt(a)) -> matrix (the same for sin(), cos(), etc.)
Has any reason for this behaviour?
-- ***************************************** José Luis García Pallero address@hidden (o< / / \ V_/_ Use Debian GNU/Linux and enjoy! *****************************************