From a quick test you might not be asigning the x and y values when performing your contour() function. by doing so matlab will automatically assign the row and column indexing to match the matrix. So in your example your max data is at the bottom row which is technically the higher value in cartesian coordinates of row 10 (ie y axis 10). you can get around this by defining your x and y values to plot against.
so matrix position (1,1) (row 1, column 1) is top left, but when displayed it'll be bottom left.