MathGroup Archive 2013

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

Search the Archive

Re: Changing a list with the information of other


Here is one way:

a = {{0, 1}, {1, w}, {2, 1 + w}, {3, 1 + 2 w}, {4, 2}, {5, 2 w}, {6, 
    2 + 2 w}, {7, 2 + w}};
b = {1, 1 + w, 2 + w, 2 w, 2, 2 + 2 w, 1 + 2 w, w};

Apply[#1 &, 
 Flatten[Table[Select[a, #[[2]] == b[[i]] &, 2], {i, 1, b // Length}],
   1], 1]

{0, 2, 7, 5, 4, 6, 3, 1}



  • Prev by Date: Re: Calculating derivate in Mathematica 9 giving wrong result
  • Next by Date: Re: Animate Command and Vector Reference
  • Previous by thread: Re: Changing a list with the information of other
  • Next by thread: files