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: pdv.m
    path of file: ./repos/prima/benchmark/rescue_idz/matlab/tests
    
    the code of the file until where you have to start completion: function pdv
% PDV tests the Fortran solvers for all precision, debugging flags, and variants.

oldpath = path();  % Record the current path.
restoredefaultpath;  % Restore the "right out of the box" path of MATLAB

olddir = pwd();  % Record the current directory.

matlab_implemented = {'newuoa'};  % Solvers that has a MATLAB implementation.

% Prepare the test directory, i.e., `test_dir`.
callstack = dbstack;
funname = callstack(1).name; % Name of the current function
fake_solver_name = funname;
options.compile = true;
test_dir = prepare_test_dir(fake_solver_name, funname, options);

exception = [];

try

    % Go to the test directory. This is not really necessary. It will not affect the test, but any
    % output (e.g., NEWUOA_output.txt, fort.6) will be dumped to `test_dir`.
    cd(test_dir);

    % Compile the solvers.
    clear('setup');
    opt=struct();
    opt.verbose = true;
    opt.single=true;
    opt.quadruple=true;
    opt.debug=true;
    opt.classical=true;
    tic
    setup(opt);
    testprima
    toc

    solvers = {'cobyla', 'uobyqa', 'newuoa', 'bobyqa', 'lincoa'};
    precisions = {'double', 'single', 'quadruple'};
    debug_flags = {true, false};
    variants = {'modern', 'classical'};

    % Show current path information.
    showpath(solvers);

    % Test the solvers.
    fun = @sin;
    x0 = 1;

    
function pdv
% PDV tests the Fortran solvers for all precision, debugging flags, and variants.

oldpath = path();  % Record the current path.
restoredefaultpath;  % Restore the "right out of the box" path of MATLAB

olddir = pwd();  % Record the current directory.

matlab_implemented = {'newuoa'};  % Solvers that has a MATLAB implementation.

% Prepare the test directory, i.e., `test_dir`.
callstack = dbstack;
funname = callstack(1).name; % Name of the current function
fake_solver_name = funname;
options.compile = true;
test_dir = prepare_test_dir(fake_solver_name, funname, options);

exception = [];

try

    % Go to the test directory. This is not really necessary. It will not affect the test, but any
    % output (e.g., NEWUOA_output.txt, fort.6) will be dumped to `test_dir`.
    cd(test_dir);

    % Compile the solvers.
    clear('setup');
    opt=struct();
    opt.verbose = true;
    opt.single=true;
    opt.quadruple=true;
    opt.debug=true;
    opt.classical=true;
    tic
    setup(opt);
    testprima
    toc

    solvers = {'cobyla', 'uobyqa', 'newuoa', 'bobyqa', 'lincoa'};
    precisions = {'double', 'single', 'quadruple'};
    debug_flags = {true, false};
    variants = {'modern', 'classical'};

    % Show current path information.
    showpath(solvers);

    % Test the solvers.
    fun = @sin;
    x0 = 1;
    for isol = 1 : length(solvers)
        solver = str2func(solvers{isol});
        solver
        options = struct();
        for iprc = 1 : length(precisions)
            options.precision = precisions{iprc};
            for idbg = 1 : length(debug_flags)
                options.debug = debug_flags{idbg};
                for ivar = 1 : length(variants)
                    options.classical = strcmp(variants{ivar}, 'classical');
                    options.output_xhist = true;
                    options
                    format long
                    [x, f, exitflag, output] = solver(fun, x0, options)
                    if (ismember(solvers{isol}, matlab_implemented))
                        options_mat = options;
                        options_mat.fortran = false;
                        [x, f, exitflag, output] = solver(fun, x0, options_mat)
                    end