MATLAB: Super class get callers name

object class

Hi,
when a subclass calls a superclass, is there a way to get the name of the caller (subclass)?
Cheers, Frank.

Best Answer

Found it. Just call this:
me = class(obj);
this gives the name of the created subclass. I call it in the constructor of the superclass:
function obj = mySuperClass() %constructor
me = class(obj);
obj.name = me;
end
Related Question