Hi,
I'm working on a OOP-Script and was wondering how nested functions in Methods behave.
I don't have a particular example yet, I just played around a little and coudn't make it work.
I imagine somethin like this:
classdef example properties one two end methods %Constructor
function obj = example(1,2) obj.one = 1 obj.two = 2 end function parent(obj) X = 1 + child function child(obj) [...] end end endend
I tried to call the "child" function from a different script to see it's value but always got errors like "no static Method or propertie" or "not enough input arguments"
I tried calling it like
example.parent.child(1,2) example.child(1,2)@example.child
and a couple other options.
My try and error progress got me thinking if this is even possible at all?
Any tipps and tricks are highly appreciated!
Best Answer