%
%  Function to vectorize upper triangular part of 
%  a matrix.
%
function vx = vtri(X)
   m = size(X,1);
   n = size(X,2);
   
   k = 1;
   for i=1:m
      for j = i:n
         vx(k) = X(i,j);
	 k = k + 1;
      end
   end

end
