Hi,
I have an inner function nested inside a for loop of a parent function. I would like to define a structure once inside the parent and have that pass through each of the nested functions inside the loop without needing to redefine the structure.
function ParentFunction(x,y,z) MyStructure = AnotherFunction(z) for i in 1:100 [output] = InnerFunction(MyStructure, x(i), y, z); % do stuff with output
end end
I need to pass MyStructure (which I only want to have to define once) through each iteration of the for loop. How can I do this?
Thanks
Best Answer