displaying the sorted result

조회 수: 1 (최근 30일)
PRAVEEN GUPTA
PRAVEEN GUPTA 2019년 8월 8일
댓글: madhan ravi 2019년 8월 8일
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

채택된 답변

madhan ravi
madhan ravi 2019년 8월 8일
Use sort() and fprintf().
  댓글 수: 2
PRAVEEN GUPTA
PRAVEEN GUPTA 2019년 8월 8일
fprintf will not give : "X(1)"
fprintf will give value of X(1)..??
madhan ravi
madhan ravi 2019년 8월 8일
Yes, use compose().

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by