Re: Following position change in different vectors
- To: mathgroup at smc.vnet.net
- Subject: [mg117495] Re: Following position change in different vectors
- From: "Harvey P. Dale" <hpd1 at nyu.edu>
- Date: Mon, 21 Mar 2011 06:12:41 -0500 (EST)
Tamas: v1=={1,3,2}; v2=={a,c,b}; Transpose[Sort[Thread[{v1,v2}]]] -> {{1,2,3},{a,b,c}} Best, Harvey -----Original Message----- From: Lengyel Tamas [mailto:lt648 at hszk.bme.hu] Sent: Sunday, March 20, 2011 5:53 AM To: mathgroup at smc.vnet.net Subject: [mg117495] [mg117480] Following position change in different vectors Dear Mathworld Users, Sorry for asking your help again, I hope I'm not spamming too much. My problem is the following: 1) I have 2 vectors with equal length. The positions of the first vector correspond to the second vector. So the first element of v2 is calculated from the first element of v1, etc. 2) I wish to sort the first vector in ascending magnitude using Sort[v1]. Naturally the positions of v1's elements change. What I want is the same change of position in v2's positions. (So e.g. if v1's sixth element moves after Sort to the first position, I'd like v2's same position element to follow suit) Thank you for your help in advance. Tamas ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________