フィルターのクリア

How to calculate the mean value and standard deviation of 3 specific columns?

1 回表示 (過去 30 日間)
Danai Varvatsouli
Danai Varvatsouli 2020 年 5 月 14 日
コメント済み: Sriram Tadavarty 2020 年 5 月 14 日
I have an excel file with a table 1442x31. I have extracted the 3 columns I want to calculate on a different table, named cols. Cols table size is 1439x3
And I want to calculate the mean and standard deviation of each of these columns.
I tried these:
mean_val = mean(cols);
stan_dev = std(cols);
But the result on both of mean and std was [NaN NaN NaN].
  1 件のコメント
Sriram Tadavarty
Sriram Tadavarty 2020 年 5 月 14 日
Implies the values have some NaN entries.
Try once
mean_val = mean(cols,'omitnan');
stan_dev = std(cols,'omitnan');
Hope this helps

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by