X'*scale(w,Y) should do the job.

Or if you can spare to destroy Y (or more accurately, replace it by diag(w)*Y) 
you could do X'*scale!(w,Y) which should allocate less (and therefore be 
slightly faster).

Reply via email to