MATLAB: Add 2 to the element in the 2nd row and 3rd column of given matrix.

addelement in columnelement in row

Hi!
The matrix is A=[1 3 4 2;2 0 1 6;4 1 2 7;0 3 6 4]
Add 2 to the element in the 2nd row and 3rd column of given matrix.

Best Answer

A(2,3) gives you the element in the 2nd row, 3rd column. To manipulate that value while leaving the other values of A the same,
A(2,3) = A(2,3)+2
This is Matlab 101. You'll greatly benefit from taking time to read about indexing in matlab.