Skip to main content
1-Visitor
Mar 16, 2012 3:41 AM UTC
Solved

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

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!

Ian1Answer
1-Visitor
Mar 16, 2012 9:05 AM UTC

and another variation in just 2 lines

IMG0001_2986093.PNG

IMG0002_2986093.PNG

IMG0003_2986093.PNG

IMG0004_2986093.PNG

25 replies

24-Ruby IV
Mar 16, 2012 5:16 AM UTC

May be so:

neg2pos.png

Translate
1-Visitor
Mar 16, 2012 7:29 AM UTC

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

Mike

Translate
19-Tanzanite
Mar 16, 2012 7:33 AM UTC

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

Alan

Translate
1-Visitor
Mar 16, 2012 7:35 AM UTC

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

Translate
24-Ruby IV
Mar 16, 2012 9:24 AM UTC

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!!!

Translate
1-Visitor
Mar 16, 2012 7:04 PM UTC

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!

Translate
1-Visitor
Mar 16, 2012 10:10 PM UTC

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

Translate