Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: Complement

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6119] Re: [mg6100] Complement
  • From: BobHanlon at aol.com
  • Date: Fri, 21 Feb 1997 23:46:42 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Complement[{5, 4, 3, 2, 1}, {1, 2}]

{3,4,5}

sameOrderComplement[eall_, ei__] :=
	Sort[Complement[eall, ei], 
	Position[eall, #1][[1, 1]] < 
	Position[eall, #2][[1, 1]]&]

sameOrderComplement[{5, 4, 3, 2, 1}, {1, 2}]

{5,4,3}

sameOrderComplement[{5, 4, 3, 2, 1}, {1, 2}, {1, 4}]

{5,3}

sameOrderComplement[{5, 4, 3, 6, 3, 2, 1}, {1, 2}]

{5,4,3,6}


  • Prev by Date: Progress in NonlinearFit
  • Next by Date: Re: Complement
  • Previous by thread: Progress in NonlinearFit
  • Next by thread: Re: Complement