how to add two matrix

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by