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

    function optim = setRunAPIMode(optim, mode)
%SETRUNAPIMODE Set the API version to run with.
%
%   OPTIM = SETRUNAPIMODE(OPTIM, MODE) sets the optimization to run using
%   the API defined by MODE.  MODE must be one of 0, 2 or 3.
%
%   This API mode setting is only used when the setting from the script
%   specifies that the user should be allowed to select the run interface.

%   Copyright 2005 The MathWorks, Inc.


if isscalar(mode) && ismember(mode, [0 2 3])
    optim.RunAPIMode = mode;
else
    error(message('mbc:cgoptim:InvalidArgument23'));
end