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

    function optim = setNumRuns(optim, N)
%SETNUMRUNS Set the number of runs to make
%
%  OPTIM = SETNUMRUNS(OPTIM, N) sets the number of runs that the
%  optimization is going to make.

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


oldN = optim.NumberOfRuns;
if N<oldN
    % Actually remove runs: this will remove the data from variable stores
    optim = removeRuns(optim, N+1:oldN);
else
    optim.NumberOfRuns = N;
end