iptremovecallback
Delete function handle from callback list
Description
Examples
Add and Remove Callbacks from Figure
Add three callbacks to a figure and try them interactively. Whenever MATLAB® detects mouse motion over the figure, functions f1
,
f2
, and f3
are called in that
order.
h = figure; f1 = @(varargin) disp('Callback 1'); f2 = @(varargin) disp('Callback 2'); f3 = @(varargin) disp('Callback 3'); id1 = iptaddcallback(h, 'WindowButtonMotionFcn', f1); id2 = iptaddcallback(h, 'WindowButtonMotionFcn', f2); id3 = iptaddcallback(h, 'WindowButtonMotionFcn', f3);
Remove the callback f2
. Move the mouse over the figure again.
Whenever MATLAB detects mouse motion over the figure, only functions
f1
and f3
are called.
iptremovecallback(h,'WindowButtonMotionFcn',id2);
Input Arguments
Version History
Introduced before R2006a