I would like to create a "Dependent Property" inside a "Main Class" that will handle a array of objects of "Sub Class".
Exemple:
classdef main_class properties number end properties (Dependent) % prop will be a array of sub_class object
% the size of this array will depend/change on the "number" property
prop = sub_class(); endend
If I set:
main = main_class();main.number = 3;
I would like to get:
main.prop = [sub_class(1) sub_class(2) sub_class(3)]
To me is important that "prop" be a dependent property to automatic change the number of the elements in the array.
How could I do that? Thanks!
Best Answer