Mean function not working on vector of doubles?

1 次查看(过去 30 天)
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