¿How to order 'x' numbers in ascending or descending?
显示 更早的评论
I did this for two numbers, but I find it difficult for an indefinite amount of numbers (as input vector).
I was thinking of a nested loop.
I have come to this point:
clear;
V=input('Ingrese el vector V= ');
n=length(V);
% Ordenamiento
for i=1:n
采纳的回答
更多回答(1 个)
Julien
2012-10-9
1 个投票
Hi, this function already exists on Matlab. It is called 'sort'
Additional information here
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!