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: optiprob.m
    path of file: ./repos/OPTI/Utilities/opti
    
    the code of the file until where you have to start completion: function prob = optiprob(varargin)
%OPTIPROB  Create or alter a Problem for Optimization with OPTI
%
% problem = optiprob('param1',value1,'param2',value2,...) creates an OPTI
% problem structure with the parameters 'param' set to their corresponding
% values in 'value'. Parameters not specified will be set to the OPTI
% default.
%
% problem = optiprob(oldprob,'param1',value1,...) creates a copy of the old
% problem 'oldprob' and then fills in (or writes over) the parameters
% specified by 'param' and 'value'.
%
% problem = optiprob() creates a problem structure with all fields set to
% OPTI defaults.
%
% optiprob() prints a list of all possible fields and their function.

%   Copyright (C) 2011-2013 Jonathan Currie (Control Engineering)

%If empty print a
    
function checkfield(field,value)
%Check a field contains correct data type and values
if isempty(value), return; end %empty matrix is always valid

switch lower(field)
    %Function Handle or Matrix
    case {'f','h'}
        err = opticheckval.checkNumorFHndl(value,field);
    %Function Handle
    case {'fun','hmul','hstr','nlcon','nljac','nljacstr','ode'}
        err = opticheckval.checkFunHandle(value,field);
    %-1 or 1
    case 'sense'
        err = opticheckval.checkScalarSet(value,field,[-1 1]);
    %Double Scalar
    case 'objbias'
        err = opticheckval.checkScalarDbl(value,field);
    %Double Vector
    case {'b','beq','rl','ru','lb','ub','nlrhs','nle','cl','cu','x0','sedumi b','odez0'} 
        err = opticheckval.checkDblVec(value,field);
    %Double Vector (but may be sparse)
    case 'sedumi c'
        err = opticheckval.checkDblSpVec(value,field);
    %Double Matrix
    case {'a','aeq','sedumi at'} 
        err = opticheckval.checkDblMat(value,field);        
    %Double Vector or Cell array of Double Vectors
    case {'qrl','qru','sos index','sos weight'}
        err = opticheckval.checkDblVecOrCell(value,field);
    %Double Matrix or Cell array of Double Matrices
    case {'q','l','xdata','ydata','weighting'}
        err = opticheckval.checkDblMatOrCell(value,field);
    %SOS special struct
    case 'sos'
        err = opticheckval.checkStructFields(value,field,{'type','index','weight'});
    %SDCONE special struct
    case 'sdcone'
        if(isnumeric(value))
            err = opticheckval.checkDblMat(value,field);
        elseif(iscell(value))
            err = opticheckval.checkDblMatOrCell(value,field);
        elseif(isstruct(value))
            err = opticheckval.checkStructFields(value,field,{'At','b','c','K'});
        else
            err = MException('OPTI:SetFieldError','Parameter ''%s'' should be double matrix, cell array of double matrices, or SeDuMi input structure (At,b,c,K)',field);
        end