How to generate a 2D meshgrid based on the coordinates (longitude and latitude) of points
21 views (last 30 days)
I have several points' coordinates, I want to merge a meshgrid of the points looks like the following figure.
For example, I have five points with coordinates info, the ideal generated meshgrid should be like this (the purple square which is overshadowed).
Thank you very much!
Voss on 19 Jun 2022
xy = [1 3; 2 9; 6 6; 8 8; 9 1];
% [xx,yy] = meshgrid(sort(xy(:,1)),sort(xy(:,2))) % note: maybe you want to sort x and y first
[xx,yy] = meshgrid(xy(:,1),xy(:,2))