Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

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] ====


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