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

1 vue (au cours des 30 derniers jours)
Lu Da Silva
Lu Da Silva le 17 Jan 2022
Commenté : Lu Da Silva le 17 Jan 2022
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!

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur NaNs dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by