how to do matrix addition of different sizes

1 visualizzazione (ultimi 30 giorni)
E = diag([12:4:56])
B=rand(12,3)
C=A+B

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 13 Giu 2013
C=A
C(:,1:3)=A(:,1:3)+B(:,1:3)
  3 Commenti
Azzi Abdelmalek
Azzi Abdelmalek il 13 Giu 2013
E1=diag(a+(h.*d))
E2=lambda+B;
E=E1
E(:,1:3)=E1(:,1:3)./E2(:,1:3)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by