How to find which postions in a vector has negative values and output them?
조회 수: 2 (최근 30일)
이전 댓글 표시
i have a vector and need to find the postions which has negative values
댓글 수: 0
추가 답변 (1개)
Stephen23
2018년 2월 17일
find is not required, logical indexing is simpler and more efficient:
B = A(A<0)
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!