Skip to content
Back to formatted view

Raw Message

Message-ID: <7375FB3B53851F4DA6F2285131365A6B4E42D3AE4B@EXCH-MBX-B.ulaval.ca>
Date: 2012-05-22T14:06:15Z
From: Etienne Larrivée-Hardy
Subject: 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