First time here? Check out the FAQ!

Ask Your Question
0

"Not-a-Number" NaN with arithmetical operations

asked Jul 26 '13

carlosb gravatar image

Hello,

I have a doubt. I am doing a division between two vectors (65356x1 size). Both vectors include 0s and It divides each array element. The problem is when it divides by 0s, operation (0/0), its result is not NaN, is 0!. I think It is wrong... Are there some way to get the correct result (with NaNs)?

The code is very simple: Mat G = im_g/tableReshaped; (where img_g and tableReshaped are 65356x1 matrices).

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Oct 4 '13

carlosb gravatar image

updated Nov 6 '13

It is the expected behavior and i couldn't change it. I replaced to the values with NaN manually....

Preview: (hide)

Question Tools

Stats

Asked: Jul 26 '13

Seen: 386 times

Last updated: Nov 05 '13