MathGroup Archive 2003

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

Search the Archive

Re: A short question about SetDelayed[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42517] Re: [mg42499] A short question about SetDelayed[]
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Sat, 12 Jul 2003 05:19:15 -0400 (EDT)
  • References: <200307110658.CAA17205@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Perhaps if you use Pattern in the argument of your f?
I.e., f[i_] := g[i, x], etc. And try to avoid Do's. Mathematica has neater
ways.
Tomas Garza
Mexico City
----- Original Message ----- 
From: "Vadym Kulik" <kulik_nospam at umn.edu>
To: mathgroup at smc.vnet.net
Subject: [mg42517] [mg42499] A short question about SetDelayed[]


> Hi guys:
>
> I work with Mathematica for 2 weeks and now I'm really stuck with the
> following problem:
>
> I'd like to generate an array of functions by the rule f[i]:=g[i,x], where
x
> stands for arguments some of which have been assigned numerical values; i
is
> an index, so that f[1]:=g[1,x], etc.
>
> Unfortunately, the following code doesn't work
> x = 5;   Do[f[i] := g[i, x], {i, 10}]
>
> ... neithes does this
> x = 5;   Do[f[i] := g[Evaluate[i], x], {i, 10}]
>
> Any help?
>
> Thanks,
> Vadym
>
>
>



  • Prev by Date: Re: automational generating of filenames (involving numbers)
  • Next by Date: Re: Integrating a function over a polygon
  • Previous by thread: Re: A short question about SetDelayed[]
  • Next by thread: Re: A short question about SetDelayed[]