maximum number and indexing
이전 댓글 표시
how can i find maximun number from an array for example .a=[2,44,6,77,3,9],how can i find max 2 numbers which are ,44 and 77 from a single command ? and how to know there index .thanks
답변 (1개)
madhan ravi
2019년 4월 3일
maxk(a,2)
댓글 수: 7
asad jaffar
2019년 4월 3일
madhan ravi
2019년 4월 3일
편집: madhan ravi
2019년 4월 3일
[Values,Indices] = sort(a,'descend')
[Values(1:2);Indices(1:2)]
asad jaffar
2019년 4월 3일
madhan ravi
2019년 4월 3일
I have answered the question you originally asked.
asad jaffar
2019년 4월 3일
Walter Roberson
2019년 4월 3일
You should create a different Question for this.
Jan
2019년 4월 5일
@asad: If madhan's answer solves your problem, be so kind to accept it.
카테고리
도움말 센터 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!