function p = symmmd(S)
%SYMMMD Symmetric minimum degree permutation.
%   p = SYMMMD(S), for a symmetric positive definite matrix S,
%   returns the permutation vector p such that S(p,p) tends to have a
%   sparser Cholesky factor than S.  Sometimes SYMMMD works well
%   for symmetric indefinite matrices too.
%
%   See also COLMMD, COLPERM, SYMRCM.

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.4 $  $Date: 1997/11/21 23:44:55 $

p = sparsfun('symmmd',S);
[ignore,q] = sparsfun('symetree',S(p,p));
p = p(q);
