필터 지우기
필터 지우기

who i can extract which row hasn't 'NaN' vector

조회 수: 1 (최근 30일)
Mohamuud hassan
Mohamuud hassan 2015년 5월 23일
답변: dpb 2015년 5월 23일
hello, i wrote this code:
damii(sac,xal)=isnan(1./R(sac,xal))
so who i can extract which row hasn't 'NaN' vector

채택된 답변

dpb
dpb 2015년 5월 23일
See
doc isfinite % instead
or ~isnan()
You've written an expression for an individual element of dmii unless sac and/or xal are vectors (I'm guessing not?).
To get the row of an array, use
idx=~any(isnan(dmii),2); % column vector for no NaNs in row
res=dmii(idx,:); % select those rows.
You can, if don't need the locations for other purposes wrap the reference directly and eliminate the temporary--
res=dmii(~any(isnan(dmii),2);

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by