12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ginputPurpose2ginputInput data using the mouseSyntaxDescription[x,y] = ginput(n)[x,y] = ginput[x,y,button] = ginput(...)ginput enables you to select points from the figure using the mouse or arrowkeys for cursor positioning. The figure must have focus before ginput receivesinput.[x,y] = ginput(n) enables you to select n points from the current axes andreturns the x- and y-coordinates in the column vectors x and y, respectively.You can press the Return key to terminate the input before entering n points.[x,y] = ginput gathers an unlimited number of points until you press theReturn key.[x,y,button] = ginput(...) returns the x-coordinates, the y-coordinates,and the button or key designation. button is a vector of integers indicatingwhich mouse buttons you pressed (1 for left, 2 for middle, 3 for right), or ASCIInumbers indicating which keys on the keyboard you pressed.RemarksExamplesIf you select points from multiple axes, the results you get are relative to thoseaxes coordinates systems.Pick 10 two-dimensional points from the figure window.[x,y] = ginput(10)Position the cursor with the mouse (or the arrow keys on terminals without amouse, such as Tektronix emulators). Enter data points by pressing a mousebutton or a key on the keyboard. To terminate input before entering 10 points,press the Return key.See Alsogtext2-213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!