필터 지우기
필터 지우기

How to solve this simple index problem

조회 수: 1 (최근 30일)
Rita
Rita 2015년 8월 30일
댓글: Rita 2015년 8월 30일
Hi, I have
a=[1;2;3]and b=[23;nan;4]
how I can get these
c=[2] and also D=[1,23;3,4]
Thanks a lot

채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 30일
idx = isnan(b);
c = a(idx);
D = [a(~idx), b(~idx)];

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by