Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 27 de Nov. de 2013
Editada: Andrei Bobrov el 27 de Nov. de 2013
[value1,index1] = sort(A,'descend');
out = [value1(1:4),index1(1:4)];

Más respuestas (1)

anu
anu el 28 de Nov. de 2013
but it does not work if two or more values are same ..then it is not able to select only one value from them..

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by