matrix

1 回表示 (過去 30 日間)
lowcalorie
lowcalorie 2012 年 5 月 23 日
A is an m x n array and B is an r x s array. how do i write an expression to multiply A and B and place the result in array C

採用された回答

Junaid
Junaid 2012 年 5 月 23 日
C = A * B;
Just make sure that dimensions of A and B are consistent to be multiplied as Suggested by Wayne King above.

その他の回答 (2 件)

Wayne King
Wayne King 2012 年 5 月 23 日
If n and r are not equal, you can't. Unless there are some details that you are not telling us.

Walter Roberson
Walter Roberson 2012 年 5 月 23 日
What size would you intend the result to be? Multiplication of matrices is defined if they are the same size, or if they are two dimensional (as yours are) and if the second dimension of one of them is the same as the first dimension of the other one (as yours are not)
  2 件のコメント
lowcalorie
lowcalorie 2012 年 5 月 23 日
the same size as A and B just defined as matrix C
Walter Roberson
Walter Roberson 2012 年 5 月 23 日
A and B are different sizes according to your "m x n and r x s". Are you looking for C to be m x s, or to be r x n, or to be m x n x r x s (4 dimensional), or to be m x n, or to be min(m,r) x min(n,s) or ... ?

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

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by