multiply columns of an Array
Mostrar comentarios más antiguos
Hi all, I am a beginner in Matlab and I am struggling with something.
Lets say I have: A= [1 2 1;3 1 1]; B= [1; 2]
i need to multiply the columns of A with B elements and get this result : c= [1*1 2*1 1*1 ; 3*2 1*2 1*2]
any ideas?
Thanks in Advance!
Nikolas
Respuesta aceptada
Más respuestas (1)
Alexandra Harkai
el 11 de En. de 2017
bsxfun(@times, A, B)
Or in R2016b:
A * B
1 comentario
Sean de Wolski
el 11 de En. de 2017
A.*B
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!