Hi David,
Le 27/09/2015 12:53, David Chèze a écrit :
Hi all,
I was wondering what are the possibilities to do a product element by
element between a matrix A (m rows ,n columns)and a vector (let say column
vector v (m elements) ): I want each element of each column of A to be
multiplied by each element of v at the same row. What I'm using for now is a
product by a diagonal matrix based on v. For large matrix in data
manipulation (typ. 100000 rows), it's necessary to use sparse to allocate
better the diag matrix otherwise it's out of memory for usual machine.
So i'm using --> diag(sparse(v)) * A
Have you best practise to share on this topic ?
.
I am not sure to catch what you want to do, noticeably what is the
format of the result you expect.
AFAIU, i would do
A .* (v*ones(1,size(A,2)))
Samuel
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users