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

本文介绍了在MATLAB中如何通过鼠标进行图形输入,利用GINPUT函数获取坐标轴上的点。用户可以按需选择获取指定数量的点或者无限数量的点,直到按下回车键结束。同时,函数还能返回按下的是哪个鼠标按钮或键盘按键。
摘要由CSDN通过智能技术生成
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);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值