Home How to make a container class than is able to call all class functions and apply them on all contained objects?
 I have a class 'classB' that contains multiple objects of classA as a property. classB contains the same methods as classA but applies them on all ClassA objects it contains. Is there a way to do this in a single classB function instead of adding them all with a for loop? classdef ClassB properties ClassAObj{1:3} %cell containing multiple class A objects end methods function function1(ClassB) for k = 1:numel(ClassAObj) obj.ClassAObj{k}.function1 end end function function2(ClassB) for k = 1:numel(ClassAObj) obj.ClassAObj{k}.function2 end end function... end end classdef ClassA methods function1 function2 function... end end