Removing multiple NaN's from an array

1 回表示 (過去 30 日間)
Rahul
Rahul 2012 年 5 月 30 日
I have an array ( following is a small sample, array is 32000 long
ar=35 NaN 4 5 8 NaN 4 16 NaN 32 NaN 43 NaN
I need to remove all the NaN's
such that
ar= 35 4 5 8 4 16 32 43
I cannot doit manually as the array is too big..

採用された回答

Thomas
Thomas 2012 年 5 月 30 日
Use isnan
doc isnan
in your case
ar(isnan(ar))=[]

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by