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: cfg_job.m
    path of file: ./repos/spm12/matlabbatch
    
    the code of the file until where you have to start completion: classdef cfg_job
% A command line frontend to the batch system
% obj = cfg_job
% The cfg_job object allow
    
function savejob(obj, filename)
        % Save job variable to .m file.
        % savejob(obj, filename)
        % Save the harvested job to a MATLAB script.
            [~, matlabbatch] = harvest(obj);
            str = gencode(matlabbatch);
            [fid, msg] = fopen(filename, 'w');
            if fid == -1
                cfg_message('matlabbatch:fopen', 'Failed to open ''%s'' for writing:\n%s', filename, msg);
            end