MATLAB: How to sort sparse matrices in descending order

MATLABsortsparse

When you use the SORT function with sparse matrices, it will return an error when the syntax has more than one input. This prevents me from using the SORT function with an option such as 'ascend/descend'. For example,
a = fix(rand(9,1)*10)
a = sparse(a)
a = sort(a,1,'descend');
returns the following error:
??? Error using ==> sort
Too many input arguments.

Best Answer

This enhancement has been incorporated in Release 2008b (R2008b). For previous product releases, read below for any possible workarounds:
It is not possible to sort sparse matrices in descending order with the SORT function. To work around this issue, use the FLIPUD function to flip the ascendingly sorted sparse matrices.
a = fix(rand(9,1)*10)
a = sparse(a)
a = flipud(sort(a));