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
  2 件のコメント
Karanvir singh Sohal
Karanvir singh Sohal 2021 年 4 月 4 日
Can u please explain me the significance of ".".
Stephen23
Stephen23 2021 年 4 月 4 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by