From owner-help-octave at bevo dot che dot wisc dot edu Wed Nov 13 00:18:29 1996 Subject: Re: Efficient multiplication by a diagonal matrix From: "John W. Eaton" To: Ted dot Harding at nessie dot mcc dot ac dot uk (Ted Harding) Cc: mstorti at galileo dot unl dot edu dot ar (Mario Storti), help-octave@bevo.che.wisc.edu Date: Wed, 13 Nov 1996 00:18:11 -0600 On 13-Nov-1996, Ted Harding wrote: : A good while ago I wrote to John Eaton suggesting an extension of the : octave ".*" multiplication operator so that, if A (m x n) is a matrix, : u (m x 1) and v (1 x n) are vectors, then the following could be written: [...] : John reacted favourably at the time, but I have heard no more since. I do want to add this feature. Someone has even offered patches. The problem is mostly lack of time on my part, though I expect that eventually Octave will have this feature. : I certainly have frequent call for such operations: in Statistics, I also found just yesterday that I could have used this feature, but for a different operator. What I wanted to do was subtract the mean of each column of a matrix from the elements of the corresponding column. What I ended up doing was x - ones (rows (x), :) * mean (x) but it would have been much simpler to be able to just write x .- mean (x) jwe