How to perform the following commands?
조회 수: 2 (최근 30일)
이전 댓글 표시
How to perform the following commands:
result1 = m(:,abs(m(2,:))< threshold ); .......... This line I want to exclude zero value also.(I mean if it zero ignore it and look at the next value)
[~,idx] = min(abs(result1(1,:))); ....... This line I want to exclude zero value also. (I mean if it zero ignore it and look at the next value)
댓글 수: 3
Walter Roberson
2022년 5월 24일
create a temporary vector that is abs() and replace 0 values with nan and min() that.
Or loop.
채택된 답변
Walter Roberson
2022년 5월 24일
temp = abs(result1(1,:));
temp(temp==0) = nan;
[~, idx] = min(temp) ;
댓글 수: 0
추가 답변 (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!