Home > matpower7.1 > mp-opt-model > lib > @mp_idx_manager > get.m

get

PURPOSE ^

GET Returns the value of a field.

SYNOPSIS ^

function val = get(obj, varargin)

DESCRIPTION ^

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

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

   See also OPT_MODEL.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function val = get(obj, varargin)
0002 %GET  Returns the value of a field.
0003 %   VAL = OBJ.GET(FIELD1, FIELD2, ...)
0004 %
0005 %   Example:
0006 %       var_order = obj.get('var', 'order');
0007 %
0008 %   See also OPT_MODEL.
0009 
0010 %   MP-Opt-Model
0011 %   Copyright (c) 2008-2020, Power Systems Engineering Research Center (PSERC)
0012 %   by Ray Zimmerman, PSERC Cornell
0013 %
0014 %   This file is part of MP-Opt-Model.
0015 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0016 %   See https://github.com/MATPOWER/mp-opt-model for more info.
0017 
0018 val = obj;
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 09-Oct-2020 11:21:31 by m2html © 2005