function lv = lm2lv(lm)

% lv = lm2lv(lm)
% convert label matrix to label vector
% lm - Npts*k label matrix, Npts - number of points Npts, k - number of clusters 
% lv - label vector

[Npts, k] = size(lm);    

lv = zeros(Npts,1);
for i = 1:k
    lv(lm(:,i)==1) = i;
end


