Skip to content
Prev 295280 / 398502 Next

Creating functions with a loop.

Hi

I am trying to create n functions where each function is defined in function one step before, i.e. something like

ff.k(x) = ff.j(x) - sum(1:j),      for j=k-1

Is it possible? If it isn't and I manually create each function then is their a way to call them through a loop?  My objective is to calculate something like

result.k = ff.k(x1)/ff.k(x2)      for k in 2:n

Thank you for your time,
Etienne