mean returning wrong answer

7 ビュー (過去 30 日間)
Tova Krakauer
Tova Krakauer 2020 年 12 月 5 日
コメント済み: Stephen23 2020 年 12 月 5 日
Hi,
I'm trying to calculate mean of a vector and getting a very odd answer. Here's the code:
rg_H25p0 = [29.0, 29.1, 29.5, 30.0, 30.1, 30.2, 30.3, 30.3, ...
30.3, 30.3, 30.4, 30.4, 30.4, 30.4, 30.4, 305., 30.6, 30.6, 30.7, ...
30.8, 30.9, 30.9, 31.1, 31.1, 31.1, 31.1, 31.1, 31.1, 31.4, 31.4, ...
31.4, 31.8];
mean_rg_H25p0 = mean(rg_H25p0)
Matlab keeps returning a mean of 39.1625, which is obviously impossible.
I used mean on a number of vectors and they all came out find, except for this one.
Any ideas?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 12 月 5 日
You have a 305 in second row. I think it is supposed to be 30.5.
  1 件のコメント
Tova Krakauer
Tova Krakauer 2020 年 12 月 5 日
Okay. Yes, silly mistake.
Thanks!

サインインしてコメントする。

その他の回答 (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