www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgvariable/get.m

    function out = get(obj , property)
%GET get method.
%
%  Gets the properties of the object.
%
%  Usage: get(value_obj , 'property_name')

%  Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc.




%*****
%  This function is maintained for backwards compatibility.  Please use the
%  new setXYZ, getXYZ functions for accessing the fields of this object.
%*****

if ~isa(property , 'char')
    error(message('mbc:cgvariable:InvalidPropertyName'));
end

switch lower(property)
    case {'value','values'}
        out = getvalue(obj);

    case 'type'
        warning(message('mbc:cgvariable:ObsoleteOption'));
        out = gettype(obj);

    case 'descr'
        out = getdescription(obj);

    case 'setpoint'
        out = getnomvalue(obj);

    case 'range'
        % Backwards compatibility addition
        out = repmat(getnomvalue(obj), 1,2);

    otherwise
        error(message('mbc:cgvariable:InvalidPropertyName1', property));

end