matlab中如何用鼠标随机取得坐标系上的点

GINPUT Graphical input from mouse.
%   [X,Y] = GINPUT(N) gets N points from the current axes and returns
%   the X- and Y-coordinates in length N vectors X and Y.  The cursor
%   can be positioned using a mouse.  Data points are entered by pressing
%   a mouse button or any key on the keyboard except carriage return,
%   which terminates the input before N points are entered.
%   从当前轴得到N个点,返回X坐标轴数据和Y轴坐标轴数据,用向量X和Y表示,长度为N。使用鼠标点击取点。
%   按return健结束取点。
%
%   [X,Y] = GINPUT gathers an unlimited number of points until the
%   return key is pressed.得到无穷多个数据点,按回车键return时结束取点。
%
%   [X,Y,BUTTON] = GINPUT(N) returns a third result, BUTTON, that
%   contains a vector of integers specifying which mouse button was
%   used (1,2,3 from left) or ASCII numbers if a key on the keyboard
%   was used. 
%
%   Examples:
%       [x,y] = ginput;
%
%       [x,y] = ginput(5);
%
%       [x, y, button] = ginput(1);
展开阅读全文

没有更多推荐了,返回首页