Mean function not working on vector of doubles?

1 visualización (últimos 30 días)
Erin Winkler
Erin Winkler el 17 de Abr. de 2018
Comentada: dpb el 17 de Abr. de 2018
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 comentarios
Fangjun Jiang
Fangjun Jiang el 17 de Abr. de 2018
to debug, could you try this and what is the output?
which -all mean
whos data
dpb
dpb el 17 de Abr. de 2018
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???

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by