I am reading two images as matrices in Matlab and want to create a third image, which is calculated as:
(im1-im2)./(im1+im2)
However, I believe Matlab is rounding the values of the element-wise division (which of course I don't want). For example, the first value of im1-im2
is 32 and the first value of im1+im2
is 70. So, the first value of the resulting matrix is supposed to be 32/70=0.4571
, but it is 0.
How can I do this matrix operation maintaining the original division result values in the final matrix?