GET Returns the value of a field. VAL = OM.GET(FIELD1, FIELD2, ...) Example: var_order = om.get('var', 'order'); See also OPT_MODEL.
0001 function val = get(om, varargin) 0002 %GET Returns the value of a field. 0003 % VAL = OM.GET(FIELD1, FIELD2, ...) 0004 % 0005 % Example: 0006 % var_order = om.get('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 https://matpower.org 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