How do I delete all rows in a table depending on one column's NaNs?

1 回表示 (過去 30 日間)
Lu Da Silva
Lu Da Silva 2022 年 1 月 17 日
コメント済み: Lu Da Silva 2022 年 1 月 17 日
Hi,
I have a table A:
1 2 3
NaN 4 5
3 4 NaN
I need to delete all rows where column 3 has a NaN, so as to obtain B:
1 2 3
NaN 4 5
Thanks!

採用された回答

KSSV
KSSV 2022 年 1 月 17 日
A = [1 2 3
NaN 4 5
3 4 NaN ] ;
A(isnan(A(:,3)),:)=[]
A = 2×3
1 2 3 NaN 4 5

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by