Hi,
I'm attempting to compute standarddev std of a vector, but this vector contains infinite inf values. Essentially, it outputs NaN, when I"m looking for an actual value. Is there any way to ignore any inf values so it can compute an actual value?
Thanks

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 10월 28일

0 개 추천

a=[1 2 inf 3 4 inf 5 6];
b=a(isfinite(a))
or b=a(~isinf(a))

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by