function [normvector]=normvector(W,clsn) 

wsum=sum(W);
N=length(W);
D=diag(wsum);
D1=full(D);
D2=D1^(-0.5);

I=eye(N);
X=I-D2*W*D2;

[vector,value]=eig(X);
value2=sum(value)';
[va,indv]=sort(value2);
nonzero=indv(2:clsn,:);

kvector=vector(:,nonzero);
k2vector=kvector.^2;
sm=sum(k2vector');
norm=(sm.^(0.5))';
norm3=repmat(norm,1,clsn-1);

normvector= kvector./norm3;

end

    
