If object contain an other object from another class, how can I access to the proprieties of that object from the child object ? In other words related to the example I give, how can I use the variable saved in Parent in the child ?
My parent class:
classdef Parent < handle properties name = '' ; child = {}; end methods function obj = Parent(name) obj.name = name end function createChild(obj, name) obj.child = child(name) end end end
My child class:
classdef child < handel properties name = ''; end methods function obj = child(name) obj.name = name; end function createBlock(obj) add_block('library/body', strcat(parent.name, '/', obj.name) end end end
Best Answer