Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Replacing Values Close to One

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105294] Re: [mg105265] Replacing Values Close to One
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Thu, 26 Nov 2009 06:14:53 -0500 (EST)

Hello, Georgy, 

like this?

f[x_, eps_] := If[Abs[x - 1] < eps, 1, x];

f[1.03, 0.1]
f[1.2, 0.1]

1

1.2

??
Alexei.


Hello everyone,

Is there a replacement rule that I can apply to

	{-8, .7, 0, 1.003}  /.  [what goes here?] -> 1

to replace values that are close to 1, like 1.003, by 1?

Regards,

	Gregory

-- 
Alexei Boulbitch, Dr., habil.
Senior Scientist

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg

Phone: +352 2454 2566
Fax:   +352 2454 3566

Website: www.iee.lu

This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.




  • Prev by Date: Re: Replacing Values Close to One
  • Next by Date: Re: Solve how to eliminate variable
  • Previous by thread: Re: Replacing Values Close to One
  • Next by thread: Re: Replacing Values Close to One