フィルターのクリア

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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by