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 CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by