Re: Lists
- To: mathgroup at smc.vnet.net
- Subject: [mg4020] Re: [mg3881] Lists
- From: Chee Lim Cheung/MS/SP_SF <CheeLC at sp.ac.sg>
- Date: Mon, 20 May 1996 02:13:27 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi Alex,
You can do the following:
Let givenlist = { {1, 23}, {2, 24}, {3, 25}, {4, 26} }
To extract the second element in each sublist, you can use Map and Last like
Map[ Last, givenlist ]
which will give you a vector containing the second elements of the sublists.
If you wish to regard each second element of the original list as a list, you
can map List to the above result like
Map[ List, Map[Last, givenlist] ]
This is effectively a column matrix.
I hope this helps.
==== [MESSAGE SEPARATOR] ====