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

1 次查看(过去 30 天)
e.g., from 7465 :
The digits = 7, 4, 6, and 5, so:
Minimum = 4567, the maximum = 7654

采纳的回答

Iman Ansari
Iman Ansari 2013-5-12
Hi.
A=7465;
A=num2str(A)';
Minimum=str2num(sort(A)')
maximum=str2num(sort(A,'descend')')
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Math 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by