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: [mg42521] Re: A short question about SetDelayed[]
  • From: David Monarres <dmmonarres at csupomona.edu>
  • Date: Sat, 12 Jul 2003 05:19:25 -0400 (EDT)
  • Organization: California State Polytechnic University, Pomona
  • References: <belnnp$gu3$1@smc.vnet.net>
  • Reply-to: dmmonarres at csupomona.edu
  • Sender: owner-wri-mathgroup at wolfram.com

> Unfortunately, the following code doesn't work
> x = 5;   Do[f[i] := g[i, x], {i, 10}]
I think that you need to let i be an independent variable by changing f[i]
to f[i_]. However I still don't think that will work as you want.

This is what I think you want

f[i_] := Table[g[x,j],{j,i,10}];

This will produce an array like this

f[3]

{ g[x,3],g[x,4],...,g[x,10]}


Hope that is what you wanted
-- 
dmm


  • Prev by Date: Re: Evaluation and replacement?
  • Next by Date: Re: automational generating of filenames (involving numbers)
  • Previous by thread: Re: A short question about SetDelayed[]
  • Next by thread: Re: A short question about SetDelayed[]