How can I deal with missing data ?

조회 수: 2 (최근 30일)
b.m.n n
b.m.n n 2017년 11월 12일
답변: Kaushik Lakshminarasimhan 2017년 11월 12일
I have Monthly average for wind , But two months(1and 2) it have no data , When making calculations, Nan values show me wrong results.
for example
month w_s
1 NaN
2 NaN
3 1.41962
4 2.28722
5 3.86625
6 3.33933
7 1.88889
8 2.13111
9 2.760911
10 2.094844
11 2.90875
12 3.76422
So , Is there any idea to fix this problem ?

답변 (2개)

Walter Roberson
Walter Roberson 2017년 11월 12일
... Do the calculations differently.
It is difficult to be more specific when you have not said what kind of calculation you are doing. Generally speaking, look for nanmean() and nansum() and nanstd()

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017년 11월 12일
What kind of calculations are you doing?
For basic operations such as sum, mean, std, max, median etc., you can use the 'nan' variant of those functions: nansum, nanmean, nanstd, nanmax, nanmedian. These variants basically discard ignore nan values when performing calculations.

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by