displaying the sorted result

1 vue (au cours des 30 derniers jours)
PRAVEEN GUPTA
PRAVEEN GUPTA le 8 Août 2019
Commenté : madhan ravi le 8 Août 2019
hello,
i have an array with values "x=[12 34 45 67 82 32 32]", i have to arrange it in ascending order and then display it one by one as "X(1)=12", "X(2)=32"..
thanks in advance

Réponse acceptée

madhan ravi
madhan ravi le 8 Août 2019
Use sort() and fprintf().
  2 commentaires
PRAVEEN GUPTA
PRAVEEN GUPTA le 8 Août 2019
fprintf will not give : "X(1)"
fprintf will give value of X(1)..??
madhan ravi
madhan ravi le 8 Août 2019
Yes, use compose().

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by