How to extract a specific value within given range and row and column number which has a specific value.
조회 수: 2 (최근 30일)
이전 댓글 표시
Just like the question, I want to extract row and column numbers.
example I want to find a closest value to 0.003 (there is no 0.003 in a matrix) in a n x 1 matrix.
How can I code it.
댓글 수: 0
답변 (1개)
Nobel Mondal
2015년 10월 2일
>> randMatrix = (0.02*rand(5,1) - 0.01); % A random 5x1 matrix
>> [~, id] = min(abs(randMatrix - 0.003));
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!