antiseptic
Bioengineer
- Jan 15, 2003
- 11
hi all
i am trying to design a recursive function that would "spawn" a child process everytime a condition is met
to keep it simple:
function output = recursive_function(parameters)
if (condition_is_met)
recursive_function(parameters)
end
output=whatever;
i want to "keep track" of the "spawned childs", that is, assign an index to them (lets say "i" that gets incremented with each new child
i thought i could do that defining a "global" variable to the function, but i cant get it done
can anyone help me?
thanx
i am trying to design a recursive function that would "spawn" a child process everytime a condition is met
to keep it simple:
function output = recursive_function(parameters)
if (condition_is_met)
recursive_function(parameters)
end
output=whatever;
i want to "keep track" of the "spawned childs", that is, assign an index to them (lets say "i" that gets incremented with each new child
i thought i could do that defining a "global" variable to the function, but i cant get it done
can anyone help me?
thanx