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
>> get(gca, 'CurrentPoint')
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 data cursor to get data from a 3-D plot.
After clicking on a point in the graph, you can right-click on the data tip that appears and select "Export Cursor Data to Workspace"; the position information will then be accessible in the exported variable. Additionally, if you wish to do this programmatically, you can use the following code with 'getCursorInfo': dcm = datacursormode(gcf)
data = getCursorInfo(dcm)