Getting -Inf when applying the mean to log values

조회 수: 4 (최근 30일)
Yasmin Samy
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

채택된 답변

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
Star Strider
Star Strider 2017년 12월 20일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by