% Function descsort sorts, in the descending order, a real array a.
% Second output parameter j holds a permutation used to obtain
% array b from the array a.

function [b, j] = descsort(a)
[b ,j] = sort(-a);
b = -b;
