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: linear_vonMises_to_cpot.m
    path of file: ./repos/bnt/BNT/general
    
    the code of the file until where you have to start completion: function pot = linear_vonMises_to_cpot(mu, k, W, domain, ns, cnodes, evidence)
% LINEAR_VONMISES_TO_CPOT Convert a linear Von Mises CPD  to a canonical potential.
% pot = linear_vonMises_to_cpot(mu, Sigma, W, domain, ns, cnodes, evidence)
%
% We include any cts evidence, but ignore any discrete evidence.
% (Use vonMises_CPD_params_given_dps to use discrete evidence to select mu, Sigma, W.)

odom = domain(~isemptycell(evidence(domain)));
hdom = domain(isemptycell(evidence(domain))); 
cobs = myintersect(cnodes, odom);
chid = myintersect(cnodes, hdom);
cvals = cat(1, evidence{cobs});

%[g,h,K] = vonMises_to_canonical(mu, Sigma, W);
g = log(1/(2*pi*besseli(0,k)));

    
function pot = linear_vonMises_to_cpot(mu, k, W, domain, ns, cnodes, evidence)
% LINEAR_VONMISES_TO_CPOT Convert a linear Von Mises CPD  to a canonical potential.
% pot = linear_vonMises_to_cpot(mu, Sigma, W, domain, ns, cnodes, evidence)
%
% We include any cts evidence, but ignore any discrete evidence.
% (Use vonMises_CPD_params_given_dps to use discrete evidence to select mu, Sigma, W.)

odom = domain(~isemptycell(evidence(domain)));
hdom = domain(isemptycell(evidence(domain))); 
cobs = myintersect(cnodes, odom);
chid = myintersect(cnodes, hdom);
cvals = cat(1, evidence{cobs});

%[g,h,K] = vonMises_to_canonical(mu, Sigma, W);
g = log(1/(2*pi*besseli(0,k)));
if isempty(W) | (size(W,2)==0)  % no cts parents
  h = k*cos(mu);
  K = k*sin(mu);
else
  %currently not implemented
   error('cts parents not supported yet');
end