Get Terrain Height Matlab For Loop