classdef testClass < handle
events
testevent
end
methods
function obj = testClass
lh = obj.addlistener('testevent', @obj.respond);
lh.Recursive = true;
end
function raise(obj)
notify(obj,'testevent');
end
function respond(obj, varargin)
fprintf('Responded!\n');
obj.raise();
end
end
end
matlab event notify recursive
最新推荐文章于 2021-07-19 20:55:21 发布