Multiplication of elements of matrix without using for loop

조회 수: 1 (최근 30일)
Karanvir singh Sohal
Karanvir singh Sohal 2021년 4월 3일
댓글: Stephen23 2021년 4월 4일
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]

채택된 답변

David Fletcher
David Fletcher 2021년 4월 3일
A.*B
ans =
1.0000 1.0000 0.9999
0.2500 0.4000 0.4998
0.1400 0.2400 0.3333

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by