MATLAB: How can i get the index of all matrix value

matrixmeshgridrow and column coordinates

hello!
i have a matrix A , i want to find the index of all value in the matrix not a specific value like shown in B
A=[7 9 10 12 14 B=[1 1 1 1 1
20 25 30 17 15 2 2 2 2 2
27 10 32 28 8 3 3 3 3 3
11 13 26 34 16] 4 4 4 4 4]

Best Answer

Are you looking for something like this
A;
B = repmat((1:size(A,1)).', 1, size(A,2))