# Documentation of subset_old

Global Index (all files) (short | long)
| Local Index (files in subdir) (short | long)

## Function Synopsis

x = subset(y, nxa, nya, frame);

## Help text

x = subset(y, nxa, nya, frame);
This returns a matrix x (cols = time, rows = space) that is
a region in y defined by frame
frame = [w e s n] limits

## Cross-Reference Information

## Listing of function subset_old

function x = subset(y, nxa, nya, frame);
xkeep=[];
for i=1:length(nxa);
if (nxa(i) >= frame(1)) & (nxa(i) <= frame(2));
xkeep = [xkeep i];
end
end
ykeep=[];
for i=1:length(nya);
if (nya(i) >= frame(3)) & (nya(i) <= frame(4))
ykeep = [ykeep i];
end
end
if sum(size(size(y)))-1 == 2 % two dimensional input matrix
keep1=length(nxa)*(ykeep-1);
keep=[];
for i=1:length(ykeep)
keep=[keep (keep1(i)+xkeep)];
end
x = y(:, keep);
elseif sum(size(size(y)))-1 == 3 % three dimensional input matrix
x = y(:, ykeep, xkeep);
end