## -*- texinfo -*-
## @deftypefn {Function File} {@var{s} =} dsort(@var{p})
## @deftypefnx {Function File} {[@var{s}, @var{ndx}] =} dsort(@var{p})
## Sort discrete-time poles by magnitude (in decreasing order).
##
## @strong{Inputs}
## @table @var
## @item p
## Input vector containing discrete-time poles.
## @end table
##
## @strong{Outputs}
## @table @var
## @item s
## Vector with sorted poles.
## @item ndx
## Vector containing the indices used in the sort.
## @end table
##
## @seealso{eig, esort, pole, pzmap, sort, zero}
## @end deftypefn

## Author: Mark Bronsfeld <m.brnsfld@googlemail.com>
## Created: December 2016
## Version: 0.1

function [s, ndx] = dsort(p)
        if(nargin == 1)
                if(!isvector(p))
                error("dsort: argument must be a vector");
                endif
        else
                print_usage();
        endif

        [s, ndx] = sort(p, 'descend');
endfunction
