Joachim, use instead
[r,c] = find(Z==MinV) % gives two arguments
r =
28
14
c =
14
28
which will also return two values each (the row and column numbers) since there seem to be two minima. The two values you receive with your code are the indices of the minima if you count through the rows and columns of the matrix
13*41 + 28 = 561
27*41 + 14 = 1121
