MathGroup Archive 2007

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

Search the Archive

Setting Negatives to Zero

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82736] Setting Negatives to Zero
  • From: "Kevin J. McCann" <Kevin.McCann at umbc.edu>
  • Date: Tue, 30 Oct 2007 03:26:37 -0500 (EST)
  • Organization: University System of Maryland

I have a very large data set (64000 x 583) in which negative values 
indicate "no data", unfortunately these negatives are not all the same. 
I would like to efficiently set all these negatives to zero. I know that 
I will likely be embarrassed when I see how to do it, but I can't seem 
to remember or figure it out. I should emphasize that because of the 
size of the data set, this needs to be done efficiently. Another 
programming language does it as follows:

		x(x < 0) = 0;

Thanks,

Kevin
-- 

Kevin J. McCann
Research Associate Professor
JCET/Physics
Physics Building
University of Maryland, Baltimore County
1000 Hilltop Circle
Baltimore, MD 21250


  • Prev by Date: Truncated version of lognormal distribution
  • Next by Date: Re: Bug of Integrate
  • Previous by thread: Re: Truncated version of lognormal distribution
  • Next by thread: Re: Setting Negatives to Zero