I tried to run a code and I have a problem with a simple mean. I look the code and the specification of the mean is mean(x,'omitnan'). When I look the function mean in my matlab, the code didn't say anything about using "omitnan" in the function code.

3 件のコメント

Birdman
Birdman 2018 年 2 月 16 日
Can you share your code?
Guillaume
Guillaume 2018 年 2 月 16 日
The code you posted had this line:
% Copyright 1984-2015 The MathWorks, Inc.
Do not post copyrighted code
Adam
Adam 2018 年 2 月 16 日
You should always use
doc mean
to get your local version of the help instead of the online version which is for the latest version.

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

 採用された回答

Guillaume
Guillaume 2018 年 2 月 16 日

1 投票

According to the release notes the 'omitnan' option was introduced in R2015a. Therefore you must be using an older version.

1 件のコメント

Guillaume
Guillaume 2018 年 2 月 16 日
If you have the stats toolbox you can use nanmean instead.
Otherwise, you'll have to write your own function to do it. Depending on what x is, it can be trivial or quite complicated.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索

製品

タグ

質問済み:

MFP
2018 年 2 月 16 日

コメント済み:

2018 年 2 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by