how to do matrix addition of different sizes

1 visualización (últimos 30 días)
krishnamurthy
krishnamurthy el 13 de Jun. de 2013
E = diag([12:4:56])
B=rand(12,3)
C=A+B

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 13 de Jun. de 2013
C=A
C(:,1:3)=A(:,1:3)+B(:,1:3)
  3 comentarios
krishnamurthy
krishnamurthy el 13 de Jun. de 2013
sorry actually
h=rand(1,12)
Azzi Abdelmalek
Azzi Abdelmalek el 13 de Jun. de 2013
E1=diag(a+(h.*d))
E2=lambda+B;
E=E1
E(:,1:3)=E1(:,1:3)./E2(:,1:3)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by