Getting -Inf when applying the mean to log values

6 次查看(过去 30 天)
Hello all,I have a very large set of numbers. I got the log and then used the following line to get the monthly mean Fine_avg = varfun(@mean,avgFine_table,'GroupingVariables','month');
for some reason i am getting -Inf and I'm not sure why. I tried removing all negative values and zeros before getting their Log, but no effect. This isn't happening to other sets of data. Can someone let me know what i'm missing or what i should check for.
thanks

采纳的回答

Star Strider
Star Strider 2017-12-20
One option is to use min(x) or min(abs(x)) with two outputs, so you can find at least one of the elements causing the problem.
  2 个评论
Yasmin Samy
Yasmin Samy 2017-12-20
Yes thanks!!
apparently one 0.000004 seemed to be an issue for some reason. thanks i was going crazy :D

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by