
%%%%%%%%%%%%%%%%%
function v=CheckPMDV (v,x,K)
  if size(v,2)>=K
    v=v(:,1:K);
   else if size(x,2)>size(x,1)
           [su,sd,sv]=svd(x*x');
           v = x'*sv(:,1:K);
           for i=1:size(v,2);
               v(:,i)=v(:,i)/norm(v(:,i),2);
           end
         
  else if size(x,2)<=size(x,1)
          [su,sd,sv]=svd(x'*x);
           v = sv(:,1:K);          
        end
      end
  end