试试这个吧
function varargout = gtrack(newVarName,titleFmt)
objectId=3832&objectType=file
objectType=author&objectId=801347
% 缺省格式标题坐标
if nargin<2, titleFmt = '%3.5f'; end
% 获取当前图形函数事件
currFcn = get(gcf, 'windowbuttonmotionfcn');
currFcn2 = get(gcf, 'windowbuttondownfcn');
currTitle = get(get(gca, 'Title'), 'String');
% 添加数据到图形句柄
handles = guidata(gca);
if (isfield(handles,'ID') & handles.ID==1)
disp('gtrack is already active.');
return;
else
handles.ID = 1;
end
handles.currFcn = currFcn;
handles.currFcn2 = currFcn2;
handles.currTitle = currTitle;
handles.theState = uisuspend(gcf);
guidata(gca, handles);