MATLAB: How to add a value to a already existing matrix

matrix manipulation

KB=[1 3;4 5] for i:Nbarras Mgl(i,1)= Mgl(i,1) + KB(i,1)
which method is correct? for i:Nbarras Mgl(i,1)= Mgl(i,1) + KB(i,1)
or for i:Nbarras Mgl(i,1)=+KB(i,1)
or somehow else?

Best Answer

I hope the correct one, if you have already defined Mgl, is
Mgl(1,1)= Mgl(1,1) + KB(1,1)
Good luck