From four different numbers, how can I find out the minimum and maximum numbers that can created from the digits?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
e.g., from 7465 :
The digits = 7, 4, 6, and 5, so:
Minimum = 4567, the maximum = 7654
0 Kommentare
Akzeptierte Antwort
Iman Ansari
am 12 Mai 2013
Hi.
A=7465;
A=num2str(A)';
Minimum=str2num(sort(A)')
maximum=str2num(sort(A,'descend')')
3 Kommentare
Iman Ansari
am 13 Mai 2013
A=7465;
A=num2str(A)';
A_sort=sort(A);
New=str2num([A_sort([3 2 4 1])]')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Digital Filter Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!