Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)
[lat, lon, yk, xk] = keep_latlon(lim, y, x);
[lat, lon] = keep_latlon(lim, y, x); where lim = [minx maxx miny maxy] to be kept. If x and y are not input, then they are assumed to be global variables under the names XAX and YAX.
| This function calls | |
|---|---|
function [lat, lon, yk, xk] = keep_latlon(lim, y, x);
if nargin == 1;
global XAX YAX
x = XAX;
y = YAX;
end
if (lim(2) <= lim(1) | lim(4) <= lim(3))
error(['lim must be input as [minx maxx miny maxy]; '...
'try keep_var2'])
end
xk = find(x >= lim(1) & x <= lim(2));
yk = find(y >= lim(3) & y <= lim(4));
lon = x(xk);
lat = y(yk);