With MATLAB it is possible to add dynamic properties to a class instance like this:
% Define a class supporting for dynamic properties
classdef DynamicClass < dynamicprops
end
% Add a dynamic property named 'toto' to some instance
c = DynamicClass();
c.addprop('toto');
Anyhow I did not find a way to later obtain the list of dynamic properties through reflection, indeed:
m = metaclass(c);
returns an empty list for properties:
PropertyList: [0x1 meta.property]
Even listing properties in dynamicprops
superclass returns an empty list:
m.SuperClassList(1).PropertyList ==> 0x1 property array
Is there a way to obtain (through reflection) the list of dynamic properties added to a class ?
NB: Some workaround would be to maintain manual list newprop(end+1) = c.addprop(...)
but it's not very practical to pass to another base class (where til now I was working with reflection to obtain information about properties in the child class).