欠損データの行の削除方法

48 views (last 30 days)
yuki suda
yuki suda on 10 Jul 2018
Commented: Jiro Doke on 11 Jul 2018
エクセルよりデータを読み込みました。 まだ補間は行っていないため、データの欠損があります。 1列目に存在するNaNを検出し、その該当する行のみを削除するにはどのようなコードを利用すればよいでしょうか。 初心者なのでわかりません。教えてください。

Accepted Answer

lattice
lattice on 11 Jul 2018
isnan で 1 列目の NaN のある行を選んで,その行の全列を空にします.
元のデータを X とすると,
id = isnan(X(:,1));
X(id, :) = [];

More Answers (1)

yuki suda
yuki suda on 11 Jul 2018
ありがとうございます。 できました!!
  1 Comment
Jiro Doke
Jiro Doke on 11 Jul 2018
是非、latticeさんの回答を「採用」してあげてください。

Sign in to comment.

Categories

Find more on 数値型 in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!