📄 prcursor.m
字号:
%PRCURSOR Show object ident.%% PRCURSOR(H)%% Enable the datacursor in a scatterplot. This can be used to% investigate the object identifier by clicking on the object.% Copyright: D.M.J. Tax, D.M.J.Tax@prtools.org% Faculty EWI, Delft University of Technology% P.O. Box 5031, 2600 GA Delft, The Netherlandsfunction out = prcursor(h,event_obj)% This file has to tasks: % 1. to setup the datacursor (by enabling it and setting the callback% function)% 2. to provide the callback when a user pressed on an objectif ~exist('datacursormode','file') error('MATLAB 7.0 or newer is required (datacursormode.m is not available).');endif nargin ~=2 % we are doing the setup: if nargin<1 h = gcf; end dh = datacursormode(h); set(dh,'enable','on','updatefcn',@prcursor);else % we are doing the callback: nr = get(event_obj,'dataindex'); ud = get(get(event_obj,'target'),'UserData'); if ~isempty(ud) & isfield(ud,'ident') nr = ud.ident(nr); end out = sprintf('obj. %d',nr);endreturn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -