Hi
a = [1,2,3;9,8,7] b = [5,8;8,7;9,4] I can't figure out how a*b = [48,34;172,156]?
thanks

1 件のコメント

KSSV
KSSV 2017 年 12 月 27 日
It is basic...multiplying two matrices......are you aware of how to multiply two matrices?

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

 採用された回答

KSSV
KSSV 2017 年 12 月 27 日

0 投票

a = [1,2,3;9,8,7] ;
b = [5,8;8,7;9,4] ;
% ab = [48,34;172,156] ;
[n,p] = size(a) ;
[p,m] = size(b) ;
C = zeros(n,m) ;
for i=1:n
for j=1:m
C(i,j)=0.0;
for k=1:p
C(i,j) = C(i,j)+a(i,k)*b(k,j);
end
end
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2017 年 12 月 27 日

回答済み:

2017 年 12 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by