MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using "Sum" (i = 1 ... N) in a function definition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49689] Re: [mg49666] Using "Sum" (i = 1 ... N) in a function definition
  • From: Adriano Pascoletti <pascolet at dimi.uniud.it>
  • Date: Thu, 29 Jul 2004 07:42:52 -0400 (EDT)
  • References: <200407271100.HAA11129@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Use SetDelayed (:=)

	MyFunc[i_] := Sum[MyData[[j]],{j,1,i}]


Adriano Pascoletti

Il giorno 27/lug/04, alle 13:00, Rainer ha scritto:

> MyData = {3,2,4,5,6};
>  MyFunc[i_] = Sum[MyData[[j]],{j,1,i}];


------------------------------------------------------------------------ 
--------

Adriano Pascoletti
Dipartimento di Matematica e Informatica
Universita' di Udine
Via delle scienze 206
I-33100 Udine
Italy



  • Prev by Date: Problem with loops in Mathematica
  • Next by Date: pattern matching and droping elements from list of lists.
  • Previous by thread: Using "Sum" (i = 1 ... N) in a function definition
  • Next by thread: Re: Using "Sum" (i = 1 ... N) in a function definition