When you click on the figure window with the mouse, you are actually defining a line traveling into the screen along the line of sight. The 'CurrentPoint' property of the axis stores the endpoints of this
line, where the endpoints are defined by the axis limits in each dimension. The endpoints are defined in three dimensions (i.e., each endpoint is a 3-element vector); the first row of the 'CurrentPoint' value represents the endpoint farthest away from the viewer, while the second row represents the endpoint closest to the viewer.
Since the GINPUT function was intended for use with 2-D plots, it only returns two values, the x and y coordinates of the endpoint farthest from the viewer. That is, GINPUT returns the (1,1) and (1,2) elements of the 2-by-3 matrix returned by
Note: In two dimensional plots, since the line travels directly perpendicular to the X-Y plane, this accurately represents the (x,y) coordinates of the intersection of the line with the plane.
Instead of using the GINPUT function, you can use the SELECT3D function to select 3D points on surface and patch objects. This function can be found on MATLAB Central at:
Best Answer