function [randprox] = proxrand_altcomp(prox)

%  PROXRAND_ALTCOMP produces a symmetric proximity matrix RANDPROX
%  with a zero main diagonal having
%  entries that are a random permutation of those in the 
%  symmetric input proximity
%  matrix PROX.
%
%  syntax: [randprox] = proxrand_altcomp(prox)


n= size(prox,1);

change = randperm((n*(n-1))/2);

proximity_vector = squareform(prox);

randprox = squareform(proximity_vector(change));
