I have a 10×10 matrix. I want to sub a few values into the matrix simultaneously, with the other values being zero. It would be time-consuming to sub the values one by one. Is there any way to do this?
For example, A=[zeros(10,10)] A(1,1)=-4 A(2,2)=-4 A(3,3)=-4
Is there a way to sub -4 into these locations at once?
Best Answer