I'm not sure you can do anymore with your code then what you are currently doing. But, I could be completely wrong. I can suggest a few changes to your code though. You should probably change interp_x to interp_z. The values returned by interp2(x,y,test_z,given_x,y) are interpolated z values, not x values. Also, for simplicity, you can initialize x and y using the following
x = 0:100:900;
y = (0:1:9)'; % or y = (0:9)'; , b/c a step size of 1 is default
You may have known this already though.