From four different numbers, how can I find out the minimum and maximum numbers that can created from the digits?

 채택된 답변

Hi.
A=7465;
A=num2str(A)';
Minimum=str2num(sort(A)')
maximum=str2num(sort(A,'descend')')

댓글 수: 3

if it is necessary, to program counted how many of these steps need to do to get the number 6574, how can I do this with that....
A=7465;
A=num2str(A)';
A_sort=sort(A);
New=str2num([A_sort([3 2 4 1])]')

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

추가 답변 (0개)

카테고리

태그

아직 태그를 입력하지 않았습니다.

질문:

2013년 5월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by