You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: hypg_rnd.m
    path of file: ./repos/malini/Codes/FC_EC_calculation code/DynamicFC/jplv7/distrib
    
    the code of the file until where you have to start completion: function  x = hypg_rnd(num,n,K,N)
% PURPOSE: hypergeometric random draws
% prob(X=x) = (N)^-1 (K)(N-K)

    
function  x = hypg_rnd(num,n,K,N)
% PURPOSE: hypergeometric random draws
% prob(X=x) = (N)^-1 (K)(N-K)
%             (n)    (x)(n-x)
%---------------------------------------------------
% USAGE:     x = hypg_rnd(nobs,n,K,N)
% where:  nobs = number of draws
%        n,K,N = parameters of the distribution 
% NOTE: mean     = (n/N)*k
%       variance = [(n*K)/(N*N)*(N-1)]*(N-K)*(N-n)
%---------------------------------------------------
% RETURNS:
%        a vector of random draws from the distribution      
% --------------------------------------------------
% SEE ALSO: hypg_cdf, hypg_rnd, hypg_inv
%---------------------------------------------------

%       Anders Holtsberg, 18-11-93
%       Copyright (c) Anders Holtsberg
% documentation changed to match the econometrics toolbox
% by LeSage

if length(num)==1
   num = [num 1];
end