Trace the Position of Cursor without Click

It works like GINPUT provided by MATLAB,but traces the position of cursor without click ...

You are now following this Submission

function [x,y]=gpos(h_axes)
%GPOS Get current position of cusor and return its coordinates in axes with handle h_axes
% h_axes - handle of specified axes
% [x,y] - cursor coordinates in axes h_aexs
%
% -------------------------------------------------------------------------
% Note:
% 1. This function should be called in the figure callback WindowButtonMotionFcn.
% 2. It works like GINPUT provided by Matlab,but it traces the position
% of cursor without click and is designed for 2-D axes.
% 3. It can also work even the units of figure and axes are inconsistent,
% or the direction of axes is reversed.
% -------------------------------------------------------------------------

Cite As

Kang Zhao (2026). Trace the Position of Cursor without Click (https://www.mathworks.com/matlabcentral/fileexchange/4170-trace-the-position-of-cursor-without-click), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

bug fix

1.0.0.0