MATLAB Answers

0

Getting -Inf when applying the mean to log values

Yasmin Samy さんによって質問されました 2017 年 12 月 20 日
最新アクティビティ Star Strider
さんによって コメントされました 2017 年 12 月 20 日
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

  0 件のコメント

サインイン to comment.

1 件の回答

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 2017 年 12 月 20 日
Yes thanks!!
apparently one 0.000004 seemed to be an issue for some reason. thanks i was going crazy :D
Star Strider
2017 年 12 月 20 日
As always, my pleasure!

サインイン to comment.



Translated by