function xgrid = make2Dgrid(limX,limY,n)
% xgrid = make2Dgrid(limX,limY,N)
%
% creates a 2D N x N grid within the limits set by[
% limX(1)..limX(2) x limY(1)..limY(2)

stepX=(limX(2)-limX(1))/(n-1);
stepY=(limY(2)-limY(1))/(n-1);

[a,b]=meshgrid(limX(1):stepX:limX(2),limY(1):stepY:limY(2));
xgrid=[reshape(a,prod(size(a)),1),reshape(b,prod(size(b)),1)];
