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

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

Search the Archive

Re: Part

  • Subject: [mg2895] Re: Part
  • From: wagner at bullwinkle.cs.Colorado.EDU (Dave Wagner)
  • Date: 5 Jan 1996 03:47:19 -0600
  • Approved: usenet@wri.com
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: University of Colorado, Boulder
  • Sender: mj at wri.com

In article <4cgrsc$im4 at dragonfly.wri.com>,
Hans Steffani <hans.steffani at e-technik.tu-chemnitz.de> wrote:
>w={{1,2,3},{4,5,6},{7,8,9}}
>npos={2,1}
>
>npos is the position of the element I need.
>
>w[[npos]]
>
>does not work, as it returns the second and the first
>line.

This same question came up a couple of weeks ago.  You want
to use:

	w[[Sequence @@ npos]]

Sequence is an undocumented function that obliterates the head
of whatever it is applied to.  In this case, it obliterates the
List wrapper, leaving a sequence of two integers.


		Dave Wagner
		Principia Consulting
		(303) 786-8371
		dbwagner at princon.com
		http://www.princon.com/princon


  • Prev by Date: Re: Part
  • Next by Date: Re: Part
  • Previous by thread: Re: Part
  • Next by thread: Re: Part