function saveperm(p,filename)
% Function saveperm(p,filename)
%   Save a permutation vector in the named file (+.dat) using the SMMS format
eval(['fid=fopen(''' filename ''',''w'');']);
[n1,n2]=size(p);
fprintf(fid,'%d\n',n2);
fprintf(fid,'%d ',p(1,:));
fclose(fid);
