MathGroup Archive 2010

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

Search the Archive

newbie list question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114986] newbie list question
  • From: Gareth Edwards <gareth.edwards at cubicmotion.com>
  • Date: Sun, 26 Dec 2010 04:02:23 -0500 (EST)

Hi,

Liking Mathematica a lot, but struggling with the early part of the learning curve, i.e. don't know what I don't know...

What would be the neatest syntax for finding the first location of elements from one list in another? For example:

listA = { 4,5,8,2,6,4 }
listB = { 8,4,2 }


I would like a function to return {3,1,4} in this case (the first location in A of each element in B)

Many thanks!


  • Prev by Date: Use of Mathematica
  • Next by Date: Re: Building clusters out of a nested list
  • Previous by thread: Use of Mathematica
  • Next by thread: Re: newbie list question