My question is about changing values in a matrix linearly. I have a 594x1183 matrix and each cell has a value of 10. I want to change certain parts in a matrix to other values (see image below). In the solid-lined box I have a matrix with values of 10. In the dash-lined box I want to have a value of -16.
As you can see, from column 1019 to end (1183) the value should be -16. This also holds for column 1020 (to end) ... to column 1054 (to end) for the rows 54 to 182.
I can do it either manually with Excel (time-consuming) or make for every row a loop (128 loops, also time-consuming). I think there must be a quicker way to solve this problem.
So basically, for the first row (1), column 1019 to the end of matrix (column 1183) should have a value of -16 (in the first row column 1 to 1018 it has a value of 10 and from 1019 to 1183 it has a value of -16). Then the next row, the column 1020 to the end of matrix (1183) should have a value of -16 as well (in the second row, column 1 to 1019 it has a value of 10) .... repeating this to the column 1054 in row 128. So in the last row column 1 to 1053 it has a value of 10 and from 1054 to 1183 it has a value of -16.

M = 10*ones(5); M([1,4:end], [2]) = -16? - Dandoccommand. There are great tutorials on matrices and arrays. - dasdingonesin