📄 clip.m
字号:
function in=clip(x,y,area)
%CLIP Indicate which points lie outside the area.
% CLIP(X,Y,AREA) returns a logical column vector the same
% length as X with 1's for the (x,y) pairs which lie inside AREA.
% X and Y are vectors
% AREA is a four element vector [Xmin,Xmax,Ymin,Ymax]
% See AXIS
% Dr M.P. Ford 4th August 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd
% MRN019
[m,n]=size(area);
if (min(m,n)~=1)|((m*n)~=4)
error('The AREA vector has the wrong dimensions')
end
% Now index points outside or on the borders
ix=(x>=area(1))&(x<=area(2));
iy=(y>=area(3))&(y<=area(4));
in=ix(:)&iy(:);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -