MathGroup Archive 1997

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

Search the Archive

Re: Changing only Y's in a list of points: How?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6728] Re: [mg6665] Changing only Y's in a list of points: How?
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Sat, 12 Apr 1997 02:16:21 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

david at email.labmed.umn.edu (David S. Pieczkiewicz)
[mg6665] Changing only Y's in a list of points: How?
writes

>I have a list of points:
>   pointlist = { {x1,y1}, {x2,y2}, {x3,y3}, ..., {xn,yn} };
>.... I'd like to "raise" or "lower" this list, in effect, changing  
>all the y's by a constant ...

David:
 pointlist = { {x1,y1}, {x2,y2}, {x3,y3}} ;

Transpose[Transpose[ pointlist]+{0,.3}]
	{{x1, 0.3 + y1}, {x2, 0.3 + y2}, {x3, 0.3 + y3}}

Or, faster,

Thread[Thread[ pointlist]+{0,.3}]
	{{x1, 0.3 + y1}, {x2, 0.3 + y2}, {x3, 0.3 + y3}}
	
Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk


  • Prev by Date: Re: numerical value of Quantile
  • Next by Date: how to include additional 'outputs' in NDSolve ?
  • Previous by thread: Re: Changing only Y's in a list of points: How?
  • Next by thread: Re: Changing only Y's in a list of points: How?