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

エクセルよりデータを読み込みました。 まだ補間は行っていないため、データの欠損があります。 1列目に存在するNaNを検出し、その該当する行のみを削除するにはどのようなコードを利用すればよいでしょうか。 初心者なのでわかりません。教えてください。

 Accepted Answer

lattice
lattice on 11 Jul 2018

2 votes

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

More Answers (1)

yuki suda
yuki suda on 11 Jul 2018

0 votes

ありがとうございます。 できました!!

1 Comment

Jiro Doke
Jiro Doke on 11 Jul 2018
是非、latticeさんの回答を「採用」してあげてください。

Sign in to comment.

Categories

Asked:

on 10 Jul 2018

Commented:

on 11 Jul 2018

Community Treasure Hunt

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

Start Hunting!