[Gretl-users] removing nan and inf from a matrix

Logan Kelly logan.kelly at uwrf.edu
Tue Jul 23 17:50:28 EDT 2013


Hello,

I need to take the log difference of a matrix, i.e. log(M[2 rows(M):,]/M[1:rows(M)-1,]). Unfortunately, M has elements equal to zero. I need to replace the nan's and inf's with 0's. This almost works

M = isnan(M) ? 0 : M

but does not remove inf's. Any sugestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20130723/bf3331da/attachment.html 


More information about the Gretl-users mailing list