Using the function as defined:

  fn"0]i.10
0 1 33 276 1300 4425 12201 29008 61776 120825

or re-defining it to work on scalars:

fn =. 3 : 0"0
+/(1+i.y)^5
)

fn i.10
0 1 33 276 1300 4425 12201 29008 61776 120825



On 7/19/07, Glenn M. Lewis <[EMAIL PROTECTED]> wrote:

Hi all!

    Say I have a function, like so...

   fn =. 3 : 0
+/(1+i.y)^5
)
   fn 839
58340773411141200

    Now, I wish to make a table of all the values of 'fn' from 1 to
1000...  Do I have to write a 'for' loop?

    Obviously, 'fn i. 1000' doesn't work and changing 'y' to "0 y in the
function also doesn't work because of the '+/'.

    This has got to be a simple thing, but I just can't quite seem to
get it.

    Thanks!
-- Glenn


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm




--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to