MathGroup Archive 2005

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

Search the Archive

Re: List Replace Problems

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59857] Re: List Replace Problems
  • From: mike_in_england2000 at yahoo.co.uk
  • Date: Wed, 24 Aug 2005 06:30:27 -0400 (EDT)
  • References: <deeom3$3rl$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi

I am not sure if this is the most elegant way to do it but it works:

f[x_, y_] := x/y;
dlist[u_] := Flatten[MapIndexed[f, u]];

a = {1, 3, 5, 9, 7};
dlist[a]

gives

{1, 3/2, 5/3, 9/4, 7/5}

Hope this helps

Mike


  • Prev by Date: Commercial Mathematica Server
  • Next by Date: How to solve this type of equation in Mathematica?
  • Previous by thread: Re: List Replace Problems
  • Next by thread: Re: List Replace Problems