How to evaluate pdf for data containing NaN?

I need to evaluate mean, std, pdf for data in matrix (n,1) which has NaN for some rows I used 'nanmean' & 'nanstd' to calculate mean and standard deviation by ignoring nan, but I dont know how to evaluate pdf for that case.
can anyone help me in this case?

답변 (3개)

Wayne King
Wayne King 2013년 2월 25일

0 개 추천

Why not just remove the NaNs?
y = x(~isnan(x));
Youssef  Khmou
Youssef Khmou 2013년 2월 26일

0 개 추천

hi, if you are evaluating the PDF with hist, then the function automatically ignores the NAN values : or you can remove them like the answer above :
r=rand(100,1);
r(50:60)=NaN;
hist(r);
figure, hist(r(~isnan(r)))
Note : hist is not functioning with "Inf" .
Raguram
Raguram 2013년 2월 26일

0 개 추천

thanks wayne and youssef! that was helpful

카테고리

도움말 센터File Exchange에서 Probability Density Functions에 대해 자세히 알아보기

제품

태그

질문:

2013년 2월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by