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: jsonencode.m
    path of file: ./repos/ExploreASL/External/bids-matlab/+bids/+util
    
    the code of the file until where you have to start completion: function varargout = jsonencode(varargin)
  % Encode data to JSON-formatted file
  % FORMAT bids.util.jsonencode(filename,json)
  % filename - JSON filename
  % json     - JSON structure
  %
  % FORMAT S = bids.util.jsonencode(json)
  % json     - JSON structure
  % S        - serialized JSON structure (string)
  %
  % FORMAT [...] = bids.util.jsonencode(...,opts)

    
function varargout = jsonencode(varargin)
  % Encode data to JSON-formatted file
  % FORMAT bids.util.jsonencode(filename,json)
  % filename - JSON filename
  % json     - JSON structure
  %
  % FORMAT S = bids.util.jsonencode(json)
  % json     - JSON structure
  % S        - serialized JSON structure (string)
  %
  % FORMAT [...] = bids.util.jsonencode(...,opts)
  % opts     - structure of optional parameters:
  %              Indent: string to use for indentation [Default: '']
  %              ReplacementStyle: string to control how non-alphanumeric
  %                characters are replaced [Default: 'underscore']
  %              ConvertInfAndNaN: encode NaN, Inf and -Inf as "null"
  %                [Default: true]

  % Copyright (C) 2018, Guillaume Flandin, Wellcome Centre for Human Neuroimaging
  % Copyright (C) 2018--, BIDS-MATLAB developers

  if ~nargin
    error('Not enough input arguments.');
  end