Home > matpower6.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 %   Copyright (c) 2008-2016, Power Systems Engineering Research Center (PSERC)
0012 %   by Ray Zimmerman, PSERC Cornell
0013 %
0014 %   This file is part of MATPOWER.
0015 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0016 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0017 
0018 val = om;
0019 for k = 1:length(varargin)
0020     if ischar(varargin{k})
0021         val = val.(varargin{k});
0022     else
0023         val = val(varargin{k});
0024     end
0025 end

Generated on Fri 16-Dec-2016 12:45:37 by m2html © 2005