Global Index (short | long) | Local contents | Local Index (short | long)
x = subset(y, nxa, nya, frame);
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
This function calls | |
---|---|
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