Multiplication of elements of matrix without using for loop

1 visualización (últimos 30 días)
Hello everyone!
I have 2 matrixs A and B.
A=[1.00 0.50 0.3333;
0.25 0.20 0.1666;
0.14 0.12 0.1111]
B=[1 2 3]
I want another matrix which is obtained by product of element column 1 of A and element column 1 of B and so on.
size of C should be equal to size of A.
expected C matrix
C= [ 1.00 1.00 0.9999
0.25 0.40 0.4998
0.14 0.24 0.3333]

Respuesta aceptada

David Fletcher
David Fletcher el 3 de Abr. de 2021
A.*B
ans =
1.0000 1.0000 0.9999
0.2500 0.4000 0.4998
0.1400 0.2400 0.3333

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by