MathGroup Archive 1996

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

Search the Archive

RE: Help on Function


Dear Newbie:

The key to this problem is the built in function Partition.   
Partition[list, n] partitions list into
   non-overlapping sublists of length n.    Partition[list, n, d]   
generates sublists with
   offset d.

mylist = {,a2,a3,a4,a5};
whatIwant=Map[#[[1]]/#[[2]]&,Partition[mylist,2,1]]

Seth J. Chandler

 ----------
>Subject:  [mg3799] Help on Function

Hi people,

Could you please help me? I4m trying to write a function (not procedure
if possible) that works on a list such as {a1, a2, a3, a4, ...} and
returns a list {a2/a1, a3/a2, a4/a3, ...}. I know it should be an easy
task but I4m a newbe...

Thanks a lot


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: [no subject]
  • Next by Date: Re: MOVIES
  • Previous by thread: Re: Help on Function
  • Next by thread: Re: Help on Function