Determining what type of data is in my array

I'm writing a code to deal with a large data set and I'm not so great with Matlab just yet. I've searched, but I'm wondering if there is a function that asks the question "is this a double?" I need to throw out the data points that report NaN. Or is there another way that I can identify those data points?

回答 (3 件)

Sean de Wolski
Sean de Wolski 2014 年 11 月 6 日

2 投票

x = [1 nan pi]
x2 = x(~isnan(x))
isnan will be your friend.
Orion
Orion 2014 年 11 月 6 日

2 投票

use isnan
A=[1 2 3 nan 5];
isnan(A)
ans =
0 0 0 1 0
see also isfloat and class
Kendra Wright
Kendra Wright 2014 年 11 月 6 日

0 投票

Excellent. Thank you.

カテゴリ

ヘルプ センター および File ExchangeData Type Identification についてさらに検索

タグ

質問済み:

2014 年 11 月 6 日

回答済み:

2014 年 11 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by