RE: Help on Function
- To: mathgroup at smc.vnet.net
- Subject: [mg3843] RE: [mg3799] Help on Function
- From: "Chandler, Seth" <SChandler at UH.EDU>
- Date: Mon, 29 Apr 1996 00:32:30 -0400
- Sender: owner-wri-mathgroup at wolfram.com
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] ====