Hello everyone!
I want to do it a log operation in a matrix and I developed the following loop:
for ii = 1: size (IDHMA,1) for kk = size (IDHMA,2) IDHMAlog (ii,kk) = log(IDHMA(ii,kk)) if IDHMA(ii,kk) == 0 IDHMAlog(ii,kk) = NaN %exclude the"-Inf" values
else IDHMAlog (ii,kk) = log(IDHMA(ii,kk)) end end end
But the result is giving me a matrix in the same dimension but with zeros and the the log operation result only in the last column. Does anyone know how to fix it ?
Thanks
Best Answer