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 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by