function [distmatrix,xy] = gentspmat(npts) % function [distmatrix,xy] = gentspmat(npts) load usborder X=[]; Y=[]; % Form the US border in imaginary coords for the INSIDE routine w=xx+i*yy; n=0; while n