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: main_SMBO.m
    path of file: ./repos/SMBO_TeachingTool
    
    the code of the file until where you have to start completion: %=================================
    
function to evaluate error at the
    % predicted optimum (model validation, only at solution):
    f_hf_opt = objfn(xopt);
    
    % Save the high fidelity function result at the predicted optimum
    xopt_history{k} = xopt;
    f_hf_opt_history{k} = f_hf_opt;
    
    if visualization_on
        outputfn_10;        % Command window output per each iteration
        plotfn_20;          % Plot per each iteration
        plotfn_exp10;       % Export plot
    end