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

    function property_value= get(optim,property_name)
%GET Property get function
%
%  GET(OPTIM, PROP) returns the value of the specified property.

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


if nargin==1
    % just return structure
    property_value = struct(optim);
else
    switch lower(property_name)
        case 'description'
            property_value = getDescription(optim.OptimSetup);
        case 'values'
            property_value = optim.values;
        case 'om'
            property_value = optim.om;
        case 'valuelabels'
            property_value = getFreeVariables(optim.OptimSetup);
        case {'objectivelabels','objectivefunclabels'}
            property_value = getObjectiveLabels(optim.OptimSetup);
        case 'objectivefuncs'
            property_value = optim.Objectives;
        case 'constraintlabels'
            property_value = getConstraintLabels(optim.OptimSetup);
        case 'constraints'
            property_value = optim.Constraints;
        case 'oppointlabels'
            property_value = getOperatingPointSetLabels(optim.OptimSetup);
        case 'oppointvaluelabels'
            property_value = getOperatingPointSetVarLabels(optim.OptimSetup);
        case 'oppoints'
            property_value = optim.oppoints.Datasets;
        case 'oppointvalues'
            property_value = optim.oppoints.Variables;
        otherwise
            error(message('mbc:cgoptim:InvalidPropertyName', property_name));
    end
end