Mean function not working on vector of doubles?

조회 수: 1 (최근 30일)
Erin Winkler
Erin Winkler 2018년 4월 17일
댓글: dpb 2018년 4월 17일
Hi all,
I have a vector of 1000 doubles (no NaNs at all) and I'm trying to find the mean of my vector but I'm only getting NaN returned? Can anyone help?
My data looks like:
1.7694
1.9135
1.4977
1.6484
2.1447
1.8067
1.6340
1.8504
1.8398
1.7225
1.5068
1.9008
1.6895
1.7423
1.4253
2.1948
1.8581
1.7909
1.5839
1.6750
1.7101
1.6638
1.3526
1.7562
(and on to 1000 similar estimators, all doubles, no NaNs, no complex numbers, nothing wonky)
And this is what happens:
betaMRmeanB = mean(data)
betaMRmeanB = NaN
Any help would be great.
Thanks!
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2018년 4월 17일
to debug, could you try this and what is the output?
which -all mean
whos data
dpb
dpb 2018년 4월 17일
That may be what a small visible fraction looks like, but I'm betting it isn't what all the data "look like".
SHOW us, don't tell us...
all(isfinite(data))
returns???

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

답변 (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