Hi all,
I am going to generate a square map of side length rs and then divide it up into smaller squares of side length dc using meshgrid. Refer to the image and code below.
coord = 0:dc:rs;[X,Y] = meshgrid(coord);
How would I obtain the vertices of all smaller squares? Some sort of combination of X and Y must have them but I would like that a new matrix XV is an Nx5 matrix with the x-coordinates of the squares and a matrix YV is an Nx5 matrix with the y-coordinates of the squares. Each row of each matrix would correspond to a different square where N is the number of squares. Also, columns = 5 to duplicate the first column so the vertices are closed and can be used for the inpolygon function.
Best Answer