how to do matrix addition of different sizes

조회 수: 1 (최근 30일)
krishnamurthy
krishnamurthy 2013년 6월 13일
E = diag([12:4:56])
B=rand(12,3)
C=A+B

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 13일
C=A
C(:,1:3)=A(:,1:3)+B(:,1:3)
  댓글 수: 3
krishnamurthy
krishnamurthy 2013년 6월 13일
sorry actually
h=rand(1,12)
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 13일
E1=diag(a+(h.*d))
E2=lambda+B;
E=E1
E(:,1:3)=E1(:,1:3)./E2(:,1:3)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by