iterate through elements of matrix

1 回表示 (過去 30 日間)
Daniel Brower
Daniel Brower 2019 年 12 月 11 日
編集済み: ME 2019 年 12 月 11 日
How would I iterate through the elements of a matrix?
I have a 4x4 matrix A and a 4x4 matrix B. I would like to multiply each element in A with its corresponding element in B. For example, I would like to multiply A(1,1) by B(1,1), then multiply A(1,2) by B(1,2), and so on, until I get to A(4,4) by B(4,4).
  1 件のコメント
Chuguang Pan
Chuguang Pan 2019 年 12 月 11 日
A.*B

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

回答 (1 件)

ME
ME 2019 年 12 月 11 日
編集済み: ME 2019 年 12 月 11 日
Chuguang Pan answer is correct but is in the comments section rather than the answers section. This won't be able to be accepted unless posted in the answer section.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by