ginput
[x, y, button] = ginput (n) [x, y, button] = ginput () xy = ginput (n) Read points with the mouse from the current axes. The function waits until N points have been clicked, or, without N, until Return is pressed. X and Y are the data coordinates (column vectors); BUTTON holds the mouse button number or the key code of each point. With a single output the n-by-2 matrix [x y] is returned. This blocks and needs a toolkit that delivers mouse events.