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: json2mcx.m
    path of file: ./repos/mcxcl/utils
    
    the code of the file until where you have to start completion: function cfg = json2mcx(filename)
%
% Format:
%    cfg=json2mcx(filename)
%
% Convert a JSON file for MCX binary to an MCXLAB c
    
function depends on the savejson/loadjson functions from the
%    Iso2Mesh toolbox (http://iso2mesh.sf.net) or JSONlab toolbox
%    (http://iso2mesh.sf.net/jsonlab)
%
% This function is part of Monte Carlo eXtreme (MCX) URL: http://mcx.space
%
% License: GNU General Public License version 3, please read LICENSE.txt for details
%

if (ischar(filename))
    json = loadjson(filename);
elseif (isstruct(filename))
    json = filename;
else
    error('first input is not supported');
end