This is the code!
function y = mysort(x)
% Emulates the Matlab internal function ‘sort’
N = length(x);
for j = N:-1:2
track = x(1);
tracki = 1;
for i = 2:j
if x(i) > track
track = x(i);
tracki = i;
end
end
x(tracki) = x(j);
x(j) = track;
end
y = x;