MATLAB: function to display the name of an instance of a class (object)
I'm stuck with what I expect should be something relatively simple. I am writing a class Superclass
such that:
Superclass < handle
and then:
MyClass < Superclass
MyClass
contains a function DisplayObjectName
that should do what the name suggests. That is, display the name of the instance of the class (object).
For example, I create an object:
TestObject = MyClass(inputvariable);
Then I would like to have a function such that when calling
TestObject.DisplayObjectName()
the way out will be
ans = TestObject
I couldn't find a way to do this. Any ideas? Any help would be much appreciated.
+3
source to share