필터 지우기
필터 지우기

how to add two matrix

조회 수: 1 (최근 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 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