A row matrix B=[21 43 23 65]. Now I want to sort them in ascending order and also want the order of their location. How to do this??? I want the output file look like: [21 23 43 65] and [1 3 2 4].

 Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Nov. de 2015

0 votos

[sorted, order] = sort(B)

1 comentario

PARTHA HALDAR
PARTHA HALDAR el 27 de Nov. de 2015
for B=[21 43 23 65] i have the outfile as reported but if B=[21 43 21 65] then two answers should come one is [1 3 2 4] and another one is [3 1 2 4]. This is not coming...

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 27 de Nov. de 2015

Comentada:

el 27 de Nov. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by