how we can select 2 or more variables from an array depending on their values.

like i have an array of say 100 variables.i want to select 4 variables from this array whose values are maximum in that array.what kind of command is available rather than max in matlab?

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 11월 27일
편집: Andrei Bobrov 2013년 11월 27일
[value1,index1] = sort(A,'descend');
out = [value1(1:4),index1(1:4)];

추가 답변 (1개)

anu
anu 2013년 11월 28일
but it does not work if two or more values are same ..then it is not able to select only one value from them..

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

질문:

anu
2013년 11월 27일

댓글:

anu
2013년 11월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by