How to determine if object has a defined event

Is there a way to determine if an object instance imlements an event like ismethod for methods and isprop for properties?
I tried isevent but it seems to be related only to COM components
I know I can use metaclass but it's much more tedious
and i don't mean something like that:
try
addlistener(whatever goes here);
catch ME
% no such event
end

 Accepted Answer

Best method I found was
ismember('EventName', events(obj));

More Answers (0)

Categories

Asked:

on 27 Jan 2019

Answered:

on 6 Feb 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!