have two columns that are the same size but one of them has NAN on the first and last row, how would i delete those rows for both columns
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
Ruger28
2020년 3월 2일
a = 1:10;
b = 1:10;
b(1) = NaN;
b(end) = NaN;
NaN_Vals = find(isnan(b));
a(NaN_Vals) = [];
b(NaN_Vals) = [];
댓글 수: 2
Ruger28
2020년 3월 4일
No problem! The issue is usually that you remove a row, and then the index is off. Easiest way is to create a list of values (like NaN_Vals) and remove them after the fact, all at once.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!