multiply lines of a matrix by a line
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
given a matrix A = (Aij) and an horizontal array b = (bj), with B and A of the same width, is there a command that returns a matrix C of the same size as A, and whose each element Cij = Aij * bj ?
I tried C = A .* b but it only works when A is an array as b.
Thanks!
0 comentarios
Respuestas (1)
Andrei Bobrov
el 13 de Sept. de 2013
Editada: Andrei Bobrov
el 13 de Sept. de 2013
C = bsxfun(@times,A,b);
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!