how to do matrix addition of different sizes

 Accepted Answer

C=A
C(:,1:3)=A(:,1:3)+B(:,1:3)

3 Comments

How to Calculate E
lambda=rand(1);
h-rand(1,12);
a=rand(1,12);
d=rand(1,12);
B=rand(12,3);
E=[(diag(a+(h.*d))./lambda)]+B;
E1=diag(a+(h.*d))
E2=lambda+B;
E=E1
E(:,1:3)=E1(:,1:3)./E2(:,1:3)

Sign in to comment.

More Answers (0)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!