Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: Extracting elements of lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45486] Re: [mg45458] Extracting elements of lists
  • From: "Sseziwa Mukasa,,(978) 536-2359" <mukasa at jeol.com>
  • Date: Sat, 10 Jan 2004 00:00:33 -0500 (EST)
  • References: <200401091020.FAA24583@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Jan 9, 2004, at 5:20 AM, sashan wrote:

> Hi
>
> I'm trying to extract a elements from a list and return another list
> with those elements. I've tried doing it using a while loop and
> recursion and haven't been able to do it.
>
> The list I'm working with is a list of lists where each inner list
> contains 4 elements. Example:
> {{0, 1, 0, 0}, {0.04, 1, -0.0008, 0}, {0.1, 0.999987, -0.00499995,
>      0}, {0.15, 0.999937, -0.0112494, 0}, {0.18, 0.999869, -0.0161983,
> 0},....
>

Try

l[[All,{1,2}]]

I suggest looking at Part in the documentation.

Regards,

Ssezi


  • Prev by Date: Graphics / cosmetics
  • Next by Date: Re: finding eigenvalues
  • Previous by thread: Extracting elements of lists
  • Next by thread: Re: Extracting elements of lists