super class get callers name

조회 수: 9 (최근 30일)
Frank
Frank 2013년 2월 17일
Hi,
when a subclass calls a superclass, is there a way to get the name of the caller (subclass)?
Cheers, Frank.

채택된 답변

Frank
Frank 2013년 2월 19일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subclass Applications에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by