[~,i]=max(y); what does it mean in matlab
조회 수: 14 (최근 30일)
이전 댓글 표시
can i know the meaning of this command "[~,i]=max(y);" in matlab??
댓글 수: 0
답변 (1개)
Mark Sherstan
2019년 2월 15일
편집: Mark Sherstan
2019년 2월 15일
The ~ represents an output that is discarded. It is essentially equivalent to:
[dummy,idx]=min(dists);
clear dummy
For this example, the code wants to work with the index of the minimum value, not the value itself, so the minimum value that is returned is discarded and only the index is retained.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!