Home > matlab > set_default_option.m

set_default_option

PURPOSE ^

function options=set_default_option(options,field,default)

SYNOPSIS ^

function options=set_default_option(options,field,default)

DESCRIPTION ^

 function options=set_default_option(options,field,default)
 Sets the option value 
 
 INPUTS
    options
    field:   option name
    default: assigns a value
    
 OUTPUTS
    options
        
 SPECIAL REQUIREMENTS
    none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function options=set_default_option(options,field,default)
0002 
0003 % function options=set_default_option(options,field,default)
0004 % Sets the option value
0005 %
0006 % INPUTS
0007 %    options
0008 %    field:   option name
0009 %    default: assigns a value
0010 %
0011 % OUTPUTS
0012 %    options
0013 %
0014 % SPECIAL REQUIREMENTS
0015 %    none
0016 
0017 % Copyright (C) 2003-2009 Dynare Team
0018 %
0019 % This file is part of Dynare.
0020 %
0021 % Dynare is free software: you can redistribute it and/or modify
0022 % it under the terms of the GNU General Public License as published by
0023 % the Free Software Foundation, either version 3 of the License, or
0024 % (at your option) any later version.
0025 %
0026 % Dynare is distributed in the hope that it will be useful,
0027 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0028 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0029 % GNU General Public License for more details.
0030 %
0031 % You should have received a copy of the GNU General Public License
0032 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0033 
0034 if ~isfield(options,field)
0035     options.(field) = default;
0036 end
0037 
0038 % 06/07/03 MJ added ; to eval expression

Generated on Tue 22-May-2012 02:40:23 by m2html © 2005