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: store_infos.m
    path of file: ./repos/SGDLibrary/tool
    
    the code of the file until where you have to start completion: function [infos, f_val, optgap, grad, gnorm, subgrad, subgnorm, smooth_grad, smooth_gnorm] = store_infos(problem, w, options, infos, epoch, grad_calc_count, elapsed_time)
% Function to store statistic information
%

    
function [infos, f_val, optgap, grad, gnorm, subgrad, subgnorm, smooth_grad, smooth_gnorm] = store_infos(problem, w, options, infos, epoch, grad_calc_count, elapsed_time)
% Function to store statistic information
%
% Inputs:
%       problem         function (cost/grad/hess)
%       w               solution 
%       options         options
%       infos           struct to store statistic information
%       epoch           number of outer iteration
%       grad_calc_count number of calclations of gradients
%       elapsed_time    elapsed time from the begining
% Output:
%       infos           updated struct to store statistic information
%       f_val           cost function value
%       outgap          optimality gap
%       grad            gradient
%       gnorm           norm of gradient
%       subgrad         subgradient
%       subgnorm        norm of subgradient
%       smooth_grad     smoothed gradient
%       smooth_gnorm    norm of smoothed gradient
%
% This file is part of SGDLibrary.
%
% Created by H.Kasai on Sep. 25, 2017
% Modified by H.Kasai on Mar. 27, 2017
% Modified by H.Kasai on Oct. 30, 2020

    subgrad = [];
    subgnorm = [];

    if ~epoch
        
        infos.iter = epoch;
        infos.time = 0;    
        infos.grad_calc_count = grad_calc_count;
        f_val = problem.cost(w);
        optgap = f_val - options.f_opt;
        % calculate norm of full gradient
        grad = problem.full_grad(w);
        gnorm = norm(grad); 
        if ismethod(problem, 'full_subgrad')
            subgrad = problem.full_subgrad(w);
            subgnorm = norm(subgrad); 
            infos.subgnorm = subgnorm;  
        end