displaying the sorted result

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

 Accepted Answer

madhan ravi
madhan ravi on 8 Aug 2019
Use sort() and fprintf().

2 Comments

fprintf will not give : "X(1)"
fprintf will give value of X(1)..??
Yes, use compose().

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!