필터 지우기
필터 지우기

How to delete nan from array

조회 수: 540 (최근 30일)
Hana
Hana 2015년 1월 13일
댓글: Yang Liu 2022년 8월 4일
B=[nan 8 nan;6 nan nan;6 5 8] C=[nan 4 nan;4 nan nan;5 3 2]
Answer: B=[8 6 6 5 8] C=[4 4 5 3 2]

채택된 답변

Guillaume
Guillaume 2015년 1월 13일
편집: Guillaume 2015년 1월 13일
B = B';
B = B(~isnan(B))';
C = C';
C = C(~isnan(C))';
  댓글 수: 3
Guillaume
Guillaume 2015년 1월 13일
Yes, not sure what I was thinking.
Yang Liu
Yang Liu 2022년 8월 4일
Why use '? Why not just B=B(~isnan(B))?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by