-4

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)
Lokesh A. R.
  • 2,326
  • 1
  • 24
  • 28
user2663548
  • 7
  • 1
  • 3
  • 1
    What do you mean by even grid? Are you thinking it should be spaced identically on x and y directions? – Lokesh A. R. Jan 19 '14 at 16:40
  • Yes Lokesh, apologies for not being 100% clear. In this context, even means uniformly spaced in the x and y directions. I read somewhere that a grid can be uniform but have different spacing in the x and y direction. – user2663548 Jan 19 '14 at 17:04
  • @user2663548: This is a matter of definition, I don't see any programming question. – Daniel Jan 19 '14 at 18:07
  • Ok, perhaps put in another way; If one were to create a grid with equidistant x and y points within the long and lat bounds defined above, what values / how would you define the grid spacing? – user2663548 Jan 19 '14 at 19:16

1 Answers1

1

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.

Lokesh A. R.
  • 2,326
  • 1
  • 24
  • 28