Skip to main content
1-Visitor
March 16, 2012
Solved

Replace negative numbers in a Column Matrix with a different number.

  • March 16, 2012
  • 3 replies
  • 10733 views

Hello,

I have a column of data.

If the column of data has a negative number, I would like to replace that number with a very small positive number, 10^-5.

I've attached my worksheet explaining what I want to do.

Any advice?

Thanks!

Best answer by Ian1

and another variation in just 2 lines

IMG0001_2986093.PNG

IMG0002_2986093.PNG

IMG0003_2986093.PNG

IMG0004_2986093.PNG

3 replies

24-Ruby IV
March 16, 2012

May be so:

neg2pos.png

1-Visitor
March 16, 2012

How about the attached, slightly different approach to Valery's.

Mike

19-Tanzanite
March 16, 2012

Here's a third method. ( wonder how many different ways we could come up with!)

Alan

1-Visitor
March 16, 2012

Here's a third method. ( wonder how many different ways we could come up with!)

Very nice.

I always look forward to seeing your examples.

Mike

24-Ruby IV
March 16, 2012

david h wrote:

Hello,

I have a column of data.

If the column of data has a negative number, I would like to replace that number with a very small positive number, 10^-5.

I've attached my worksheet explaining what I want to do.

Any advice?

Thanks!

David, say please what is a correct answer!!!

1-Visitor
March 16, 2012

Wow!

Thanks for all of the advice. I supposed I started a competition.

Let me take a look...

It looks like Ian's was the most straight forward, though they were all good!

1-Visitor
March 16, 2012

I have to disagree. He has used a range variable which I try and keep away from at all costs.

All work, so all good 🙂

Mike