Hi, I have doubt in mean. if we have more than 10000 rows why mean doesn't work actually sum also does not work. for example, All_measured = 43472*30 double and the mean formula: mean(All_measured ,2) but the answer is 43472*1 full of NaN Any suitable ideas are very appreciable.

 채택된 답변

Star Strider
Star Strider 2017년 7월 6일

1 개 추천

Try this:
mean(All_measured ,2, 'omitnan')
or:
nanmean(All_measured ,2)

댓글 수: 4

Venkat Ta
Venkat Ta 2017년 7월 6일
편집: Stephen23 2017년 7월 6일
Hi,
Thanks a lot for the function. And if I will use same format for standard deviation (S = std(All_measured,0,2,'omitnan')), it would be correct?
Best, Venkat
Star Strider
Star Strider 2017년 7월 6일
My pleasure.
Yes.
I would change your assignment slightly, to:
S = std(All_measured,[],2,'omitnan')
The ‘[]’ indicates that an argument (here,the weight vector) is not supplied, instructing the function to use its default values, rather than giving it a numeric value.
Venkat Ta
Venkat Ta 2017년 7월 7일
Perfect. Thanks a lot.
Star Strider
Star Strider 2017년 7월 7일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

질문:

2017년 7월 6일

댓글:

2017년 7월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by