Home > matpower5.0 > @opt_model > get.m

get

PURPOSE ^

GET Returns the value of a field.

SYNOPSIS ^

function val = get(om, varargin)

DESCRIPTION ^

GET  Returns the value of a field.
   VAL = GET(OM, FIELD1, FIELD2, ...)

   Example:
       var_order = get(om, 'var', 'order');

   See also OPT_MODEL.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function val = get(om, varargin)
0002 %GET  Returns the value of a field.
0003 %   VAL = GET(OM, FIELD1, FIELD2, ...)
0004 %
0005 %   Example:
0006 %       var_order = get(om, 'var', 'order');
0007 %
0008 %   See also OPT_MODEL.
0009 
0010 %   MATPOWER
0011 %   $Id: get.m 2048 2012-05-03 12:59:07Z cvs $
0012 %   by Ray Zimmerman, PSERC Cornell
0013 %   Copyright (c) 2008-2012 by Power System Engineering Research Center (PSERC)
0014 %
0015 %   This file is part of MATPOWER.
0016 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0017 %
0018 %   MATPOWER is free software: you can redistribute it and/or modify
0019 %   it under the terms of the GNU General Public License as published
0020 %   by the Free Software Foundation, either version 3 of the License,
0021 %   or (at your option) any later version.
0022 %
0023 %   MATPOWER is distributed in the hope that it will be useful,
0024 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0025 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0026 %   GNU General Public License for more details.
0027 %
0028 %   You should have received a copy of the GNU General Public License
0029 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0030 %
0031 %   Additional permission under GNU GPL version 3 section 7
0032 %
0033 %   If you modify MATPOWER, or any covered work, to interface with
0034 %   other modules (such as MATLAB code and MEX-files) available in a
0035 %   MATLAB(R) or comparable environment containing parts covered
0036 %   under other licensing terms, the licensors of MATPOWER grant
0037 %   you additional permission to convey the resulting work.
0038 
0039 val = om;
0040 for k = 1:length(varargin)
0041     if ischar(varargin{k})
0042         val = val.(varargin{k});
0043     else
0044         val = val(varargin{k});
0045     end
0046 end

Generated on Mon 26-Jan-2015 15:21:31 by m2html © 2005