2

I'm struggling to find a practical solution to my problem and would be so much glad if you could help:

Given a few scattered starting point coordinates (black dots on the attached figure) on a nonuniform coarse grid pattern, I would like to have a nested loop to reveal the coordinates of finer grid points (as shown by yellow and red points), each sitting in the middle of a coarser square corner. And save all the points in an array.

What would be the easiest way to do it in Matlab?

Example grid

Figure is on: http://inciinwonderland.blogspot.com/

LU RD
  • 34,438
  • 5
  • 88
  • 296
La Perle
  • 31
  • 3
  • Are the starting points ordered in a way so that you know what the grid is? Or do you just have a list of coordinates, and your program first needs to decide which points are adjacent? Maybe providing (the code for) an example initial grid would be useful. – Ian Hincks Feb 14 '12 at 20:26
  • Thnx for the reply. Yes, in fact the initial grid coordinates are orderly. But then, when it saves, I'd also like to have the values in an orderly fashion (i.e. 1st row, 1st column; 1st row 2nd column etc) so that I can build a transformation matrix for further interpolation purposes. – La Perle Feb 14 '12 at 23:24

1 Answers1

0

I don't know how serious it is to you, that they are really at the diagonal, but for a super simple method you could:

Take the outer 4 points, get the mean out of it and take that as a new point. These points subsequently will be lying somewhere near the middle of the coarser gridpoints. Puls: this is easily loopable and so simple, that it should be possible to try it, even if it's not exactly what you are looking for.

BTW: the points on the borders are the means of the upper and lower (2) points. Same for horizontal.

mike
  • 791
  • 11
  • 26