Question

I am using the meshgrid function in Matlab (v. R2011b) to plot uneven thicknesses data (z) onto a long (x) and lat (y) grid before interpolating and taking an average.

(i) I have defined the spacing for meshgrid but do not know if this is evenly spaced, as the values are different in each dimension (x = 0.00025, and y = 0.0005)? What are the units for this spacing? If this is not even, are there any suggestions of what the spacing should be to create an even grid?

(ii) If this is an even grid, can anyone briefly explain how this is possible given that there are different numbers in the x and y direction?

[xi, yi] = meshgrid(25.32473:0.00025:25.426483, 36.363799:0.0005:36.49821)
Was it helpful?

Solution

There is a definition of uniform grid, where the size of the grid remains the same throughout. meshgrid will always produce a uniform grid. The x-direction and y-direction grid increments can differ in this case. You should not worry about the the increments as such if it solves your use-case.

The unit of increment is same as the unit of axis. For example, if the unit of the axis is meters, then the unit of increment would be 0.005 meters, if your increment size if 0.005.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top