how to add two matrix

2 ビュー (過去 30 日間)
janny
janny 2014 年 10 月 18 日
コメント済み: Intisar Mohammed 2020 年 5 月 31 日
hi guys i
  1 件のコメント
Intisar Mohammed
Intisar Mohammed 2020 年 5 月 31 日
Addition of two square matrices 𝐴 𝑎𝑛𝑑 𝐵 of same order.

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

採用された回答

Roger Stafford
Roger Stafford 2014 年 10 月 18 日
Let 'a' and 'b' be two row vectors. To add zeros to the left side of the shorter one so as to have equal lengths do this:
na = length(a);
nb = length(b);
n = max(na,nb);
a2 = [zeros(1,n-na),a];
b2 = [zeros(1,n-nb),b];
  4 件のコメント
janny
janny 2014 年 10 月 18 日
it works very fine.. thanks a lot
Image Analyst
Image Analyst 2014 年 10 月 18 日
Can you go ahead and officially "Accept" his answer and also "vote" for it to give him credit/reputation points for it? Thanks in advance.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by