The same stuff, but just with the "Input 2" addded in a bit more sophisticated way:
% input 1
x1 = [1 0 5 7 1 0
3 2 0 1 2 0
9 8 0 0 0 6
5 5 6 7 1 1
1 1 1 9 4 5
0 0 1 7 6 2]
x1 = 6×6
1 0 5 7 1 0
3 2 0 1 2 0
9 8 0 0 0 6
5 5 6 7 1 1
1 1 1 9 4 5
0 0 1 7 6 2
% input 2
r = 2;
c = 4;
% (i) sum 2nd and 3rd rows and (ii) remove one of the two summed rows
x2 = vertcat(x1(1:r-1,:),x1(r,:)+x1(r+1,:),x1(r+2:end,:))
x2 = 5×6
1 0 5 7 1 0
12 10 0 1 2 6
5 5 6 7 1 1
1 1 1 9 4 5
0 0 1 7 6 2
% (i) sum 4th and 5th columns and (ii) remove one of the two summed columns
x3 = [x2(:,1:c-1), x2(:,c)+x2(:,c+1), x2(:,c+2:end)]
x3 = 5×5
1 0 5 8 0
12 10 0 3 6
5 5 6 8 1
1 1 1 13 5
0 0 1 13 2