On Wed, 19 Dec 2012, Andreas Noack Jensen wrote:
I would like to support Sven's and Jack's views on this.
Their views do differ on some points ;-)
It is really convenient to work with matrices with zero columns or
rows. I agree that the number of rows should be same same for ~
and columns for |.
I think it would be a good thing if Gretl accepted zero dimension matrices
more generally.
Well, I guess Sven argued me out of my opposition to matrices with
one dimension 0 and the other non-zero. And if we're going to
support these, maybe we should support them more fully than at
present.
For example, letting zeros(5,0)*zeros(0,5) return a 5x5
zero matrix
I can see that in principle m1 (5x0) * m2 (0x5) should yield a 5x5
result. I'm not sure that I can see a principled way of determining
what the numerical content of the result should be, since neither of
the operands has any numerical content, but if all-zero is a
convention that Matlabers find useful and expect, we should at least
consider it.
and mols(mnormal(10,2),zeros(10,0),&res) return a zeros(0,2)
matrix a overwrite res with the values from mnormal(10,2). It really works
well in Matlab. It would simplify my code enormously as I could remove many
if/else statements.
Configuring mols() to do this would not be very hard, but of course
the implication is that any arbitrary matrix function should do
something analogous, and that would be a lot of work.
I don't doubt that you have good reason for requesting this, but
could you give a little example of the sort of script that would be
simplified if we went in that direction? Thanks.
Allin Cottrell