What's happening here is that you have FaceColor='flat'. In this case, it's using your 10x10 matrix as the Z values of the vertices. That means that it's creating a 9x9 grid of quadrilaterals. Because FaceColor='flat' wants to assign one color to each of those 81 quads, it doesn't use the last row and column of your data.
You might want to try FaceColor='interp', like this:
surf(mydata,'FaceColor','interp')
or create separate ZData and CData, like this:
myzdata = randn(10);
mycdata = randn(9);
surf(myzdata,mycdata)
Does that make sense?
Best Answer