Here is a simple example:
classdef simpleClassA properties prop1 end methods function obj = simpleClassA(x) obj.prop1 = x; objName = whatsMyName? fprintf('Property prop1 of %s = %g', objName, x) end end end
Then, at the command prompt, I construct an object of simpleClassA by:
Gold = simpleClassA(3.0);
and I expect this to display:
"Property prop1 of Gold = 3.0"
What function is "whatsMyName?" in my constructor method that would give me this result?
When I searched the MATLAB Answers database, the closest thing to what I want is these two links below but not exactly:
Best Answer