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_eval_valedit.m
    path of file: ./repos/bspm/thirdparty/spm8/matlabbatch/private
    
    the code of the file until where you have to start completion: function [val, sts] = cfg_eval_valedit(varargin)
% Helper function to evaluate GUI inputs in MATLAB workspace
% FORMAT [val, sts] = cfg_eval_valedit(str)
% Evaluates GUI inputs in MATLAB 'base' workspace. Results are returned
% in val. Expressions in str can be either a pure rhs argument, or a set
% of commands that assign to a workspace variable named 'val'. If
% unsuccessful, sts is false and a message window is displayed. 
%
% This code is part of a batch job configuration system for MATLAB. See 
%      help matlabbatch
% for a general overview.
%_______________________________________________________________________
% Copyright (C) 2007 Freiburg Brain Imaging

% Volkmar Glauche
% $Id: cfg_eval_valedit.m 4863 2012-08-27 08:09:23Z volkmar $

    
function [val, sts] = cfg_eval_valedit(varargin)
% Helper function to evaluate GUI inputs in MATLAB workspace
% FORMAT [val, sts] = cfg_eval_valedit(str)
% Evaluates GUI inputs in MATLAB 'base' workspace. Results are returned
% in val. Expressions in str can be either a pure rhs argument, or a set
% of commands that assign to a workspace variable named 'val'. If
% unsuccessful, sts is false and a message window is displayed. 
%
% This code is part of a batch job configuration system for MATLAB. See 
%      help matlabbatch
% for a general overview.
%_______________________________________________________________________
% Copyright (C) 2007 Freiburg Brain Imaging

% Volkmar Glauche
% $Id: cfg_eval_valedit.m 4863 2012-08-27 08:09:23Z volkmar $

rev = '$Rev: 4863 $'; 

val = [];
sts = false;
try
    % 1st, try to convert into numeric matrix without evaluation
    % This converts expressions like '1 -1' into [1 -1] instead of
    % evaluating them
    [val sts] = str2num(varargin{1}); %#ok<ST2NM>
    if ~sts
        % try to evaluate str as rvalue
        val = evalin('base', varargin{1});
        sts = true;
    end