time | calls | line |
---|
| | 1 | function [x,fval,exitflag,output] = fminsearch(funfcn,x,options,varargin)
|
| | 2 | %FMINSEARCH Multidimensional unconstrained nonlinear minimization (Nelder-Mead).
|
| | 3 | % X = FMINSEARCH(FUN,X0) starts at X0 and attempts to find a local minimizer
|
| | 4 | % X of the function FUN. FUN is a function handle. FUN accepts input X and
|
| | 5 | % returns a scalar function value F evaluated at X. X0 can be a scalar, vector
|
| | 6 | % or matrix.
|
| | 7 | %
|
| | 8 | % X = FMINSEARCH(FUN,X0,OPTIONS) minimizes with the default optimization
|
| | 9 | % parameters replaced by values in the structure OPTIONS, created
|
| | 10 | % with the OPTIMSET function. See OPTIMSET for details. FMINSEARCH uses
|
| | 11 | % these options: Display, TolX, TolFun, MaxFunEvals, MaxIter, FunValCheck,
|
| | 12 | % PlotFcns, and OutputFcn.
|
| | 13 | %
|
| | 14 | % X = FMINSEARCH(PROBLEM) finds the minimum for PROBLEM. PROBLEM is a
|
| | 15 | % structure with the function FUN in PROBLEM.objective, the start point
|
| | 16 | % in PROBLEM.x0, the options structure in PROBLEM.options, and solver
|
| | 17 | % name 'fminsearch' in PROBLEM.solver. The PROBLEM structure must have
|
| | 18 | % all the fields.
|
| | 19 | %
|
| | 20 | % [X,FVAL]= FMINSEARCH(...) returns the value of the objective function,
|
| | 21 | % described in FUN, at X.
|
| | 22 | %
|
| | 23 | % [X,FVAL,EXITFLAG] = FMINSEARCH(...) returns an EXITFLAG that describes
|
| | 24 | % the exit condition of FMINSEARCH. Possible values of EXITFLAG and the
|
| | 25 | % corresponding exit conditions are
|
| | 26 | %
|
| | 27 | % 1 Maximum coordinate difference between current best point and other
|
| | 28 | % points in simplex is less than or equal to TolX, and corresponding
|
| | 29 | % difference in function values is less than or equal to TolFun.
|
| | 30 | % 0 Maximum number of function evaluations or iterations reached.
|
| | 31 | % -1 Algorithm terminated by the output function.
|
| | 32 | %
|
| | 33 | % [X,FVAL,EXITFLAG,OUTPUT] = FMINSEARCH(...) returns a structure
|
| | 34 | % OUTPUT with the number of iterations taken in OUTPUT.iterations, the
|
| | 35 | % number of function evaluations in OUTPUT.funcCount, the algorithm name
|
| | 36 | % in OUTPUT.algorithm, and the exit message in OUTPUT.message.
|
| | 37 | %
|
| | 38 | % Examples
|
| | 39 | % FUN can be specified using @:
|
| | 40 | % X = fminsearch(@sin,3)
|
| | 41 | % finds a minimum of the SIN function near 3.
|
| | 42 | % In this case, SIN is a function that returns a scalar function value
|
| | 43 | % SIN evaluated at X.
|
| | 44 | %
|
| | 45 | % FUN can be an anonymous function:
|
| | 46 | % X = fminsearch(@(x) norm(x),[1;2;3])
|
| | 47 | % returns a point near the minimizer [0;0;0].
|
| | 48 | %
|
| | 49 | % FUN can be a parameterized function. Use an anonymous function to
|
| | 50 | % capture the problem-dependent parameters:
|
| | 51 | % f = @(x,c) x(1).^2+c.*x(2).^2; % The parameterized function.
|
| | 52 | % c = 1.5; % The parameter.
|
| | 53 | % X = fminsearch(@(x) f(x,c),[0.3;1])
|
| | 54 | %
|
| | 55 | % FMINSEARCH uses the Nelder-Mead simplex (direct search) method.
|
| | 56 | %
|
| | 57 | % See also OPTIMSET, FMINBND, FUNCTION_HANDLE.
|
| | 58 |
|
| | 59 | % Reference: Jeffrey C. Lagarias, James A. Reeds, Margaret H. Wright,
|
| | 60 | % Paul E. Wright, "Convergence Properties of the Nelder-Mead Simplex
|
| | 61 | % Method in Low Dimensions", SIAM Journal of Optimization, 9(1):
|
| | 62 | % p.112-147, 1998.
|
| | 63 |
|
| | 64 | % Copyright 1984-2012 The MathWorks, Inc.
|
| | 65 |
|
| | 66 |
|
| 26 | 67 | defaultopt = struct('Display','notify','MaxIter','200*numberOfVariables',...
|
| | 68 | 'MaxFunEvals','200*numberOfVariables','TolX',1e-4,'TolFun',1e-4, ...
|
| | 69 | 'FunValCheck','off','OutputFcn',[],'PlotFcns',[]);
|
| | 70 |
|
| | 71 | % If just 'defaults' passed in, return the default options in X
|
| 26 | 72 | if nargin==1 && nargout <= 1 && isequal(funfcn,'defaults')
|
| | 73 | x = defaultopt;
|
| | 74 | return
|
| | 75 | end
|
| | 76 |
|
| 26 | 77 | if nargin<3, options = []; end
|
| | 78 |
|
| | 79 | % Detect problem structure input
|
| 26 | 80 | if nargin == 1
|
| | 81 | if isa(funfcn,'struct')
|
| | 82 | [funfcn,x,options] = separateOptimStruct(funfcn);
|
| | 83 | else % Single input and non-structure
|
| | 84 | error(message('MATLAB:fminsearch:InputArg'));
|
| | 85 | end
|
| | 86 | end
|
| | 87 |
|
0.01 | 26 | 88 | if nargin == 0
|
| | 89 | error(message('MATLAB:fminsearch:NotEnoughInputs'));
|
| | 90 | end
|
| | 91 |
|
| | 92 |
|
| | 93 | % Check for non-double inputs
|
| 26 | 94 | if ~isa(x,'double')
|
| | 95 | error(message('MATLAB:fminsearch:NonDoubleInput'))
|
| | 96 | end
|
| | 97 |
|
| 26 | 98 | n = numel(x);
|
| 26 | 99 | numberOfVariables = n;
|
| | 100 |
|
| 26 | 101 | printtype = optimget(options,'Display',defaultopt,'fast');
|
| 26 | 102 | tolx = optimget(options,'TolX',defaultopt,'fast');
|
| 26 | 103 | tolf = optimget(options,'TolFun',defaultopt,'fast');
|
| 26 | 104 | maxfun = optimget(options,'MaxFunEvals',defaultopt,'fast');
|
0.01 | 26 | 105 | maxiter = optimget(options,'MaxIter',defaultopt,'fast');
|
| 26 | 106 | funValCheck = strcmp(optimget(options,'FunValCheck',defaultopt,'fast'),'on');
|
| | 107 |
|
| | 108 | % In case the defaults were gathered from calling: optimset('fminsearch'):
|
| 26 | 109 | if ischar(maxfun)
|
| | 110 | if isequal(lower(maxfun),'200*numberofvariables')
|
| | 111 | maxfun = 200*numberOfVariables;
|
| | 112 | else
|
| | 113 | error(message('MATLAB:fminsearch:OptMaxFunEvalsNotInteger'))
|
| | 114 | end
|
| | 115 | end
|
| 26 | 116 | if ischar(maxiter)
|
| 26 | 117 | if isequal(lower(maxiter),'200*numberofvariables')
|
| 26 | 118 | maxiter = 200*numberOfVariables;
|
| | 119 | else
|
| | 120 | error(message('MATLAB:fminsearch:OptMaxIterNotInteger'))
|
| | 121 | end
|
| 26 | 122 | end
|
| | 123 |
|
| 26 | 124 | switch printtype
|
| 26 | 125 | case {'notify','notify-detailed'}
|
| | 126 | prnt = 1;
|
| 26 | 127 | case {'none','off'}
|
| 26 | 128 | prnt = 0;
|
| | 129 | case {'iter','iter-detailed'}
|
| | 130 | prnt = 3;
|
| | 131 | case {'final','final-detailed'}
|
| | 132 | prnt = 2;
|
| | 133 | case 'simplex'
|
| | 134 | prnt = 4;
|
| | 135 | otherwise
|
| | 136 | prnt = 1;
|
| | 137 | end
|
| | 138 | % Handle the output
|
| 26 | 139 | outputfcn = optimget(options,'OutputFcn',defaultopt,'fast');
|
| 26 | 140 | if isempty(outputfcn)
|
| 26 | 141 | haveoutputfcn = false;
|
| | 142 | else
|
| | 143 | haveoutputfcn = true;
|
| | 144 | xOutputfcn = x; % Last x passed to outputfcn; has the input x's shape
|
| | 145 | % Parse OutputFcn which is needed to support cell array syntax for OutputFcn.
|
| | 146 | outputfcn = createCellArrayOfFunctions(outputfcn,'OutputFcn');
|
| | 147 | end
|
| | 148 |
|
| | 149 | % Handle the plot
|
0.02 | 26 | 150 | plotfcns = optimget(options,'PlotFcns',defaultopt,'fast');
|
| 26 | 151 | if isempty(plotfcns)
|
| 26 | 152 | haveplotfcn = false;
|
| | 153 | else
|
| | 154 | haveplotfcn = true;
|
| | 155 | xOutputfcn = x; % Last x passed to plotfcns; has the input x's shape
|
| | 156 | % Parse PlotFcns which is needed to support cell array syntax for PlotFcns.
|
| | 157 | plotfcns = createCellArrayOfFunctions(plotfcns,'PlotFcns');
|
| | 158 | end
|
| | 159 |
|
| 26 | 160 | header = ' Iteration Func-count min f(x) Procedure';
|
| | 161 |
|
| | 162 | % Convert to function handle as needed.
|
| 26 | 163 | funfcn = fcnchk(funfcn,length(varargin));
|
| | 164 | % Add a wrapper function to check for Inf/NaN/complex values
|
| 26 | 165 | if funValCheck
|
| | 166 | % Add a wrapper function, CHECKFUN, to check for NaN/complex values without
|
| | 167 | % having to change the calls that look like this:
|
| | 168 | % f = funfcn(x,varargin{:});
|
| | 169 | % x is the first argument to CHECKFUN, then the user's function,
|
| | 170 | % then the elements of varargin. To accomplish this we need to add the
|
| | 171 | % user's function to the beginning of varargin, and change funfcn to be
|
| | 172 | % CHECKFUN.
|
| 26 | 173 | varargin = {funfcn, varargin{:}};
|
| 26 | 174 | funfcn = @checkfun;
|
0.01 | 26 | 175 | end
|
| | 176 |
|
| 26 | 177 | n = numel(x);
|
| | 178 |
|
| | 179 | % Initialize parameters
|
| 26 | 180 | rho = 1; chi = 2; psi = 0.5; sigma = 0.5;
|
0.01 | 26 | 181 | onesn = ones(1,n);
|
| 26 | 182 | two2np1 = 2:n+1;
|
| 26 | 183 | one2n = 1:n;
|
| | 184 |
|
| | 185 | % Set up a simplex near the initial guess.
|
| 26 | 186 | xin = x(:); % Force xin to be a column vector
|
| 26 | 187 | v = zeros(n,n+1); fv = zeros(1,n+1);
|
| 26 | 188 | v(:,1) = xin; % Place input guess in the simplex! (credit L.Pfeffer at Stanford)
|
| 26 | 189 | x(:) = xin; % Change x to the form expected by funfcn
|
0.03 | 26 | 190 | fv(:,1) = funfcn(x,varargin{:});
|
| 26 | 191 | func_evals = 1;
|
| 26 | 192 | itercount = 0;
|
| 26 | 193 | how = '';
|
| | 194 | % Initial simplex setup continues later
|
| | 195 |
|
| | 196 | % Initialize the output and plot functions.
|
| 26 | 197 | if haveoutputfcn || haveplotfcn
|
| | 198 | [xOutputfcn, optimValues, stop] = callOutputAndPlotFcns(outputfcn,plotfcns,v(:,1),xOutputfcn,'init',itercount, ...
|
| | 199 | func_evals, how, fv(:,1),varargin{:});
|
| | 200 | if stop
|
| | 201 | [x,fval,exitflag,output] = cleanUpInterrupt(xOutputfcn,optimValues);
|
| | 202 | if prnt > 0
|
| | 203 | disp(output.message)
|
| | 204 | end
|
| | 205 | return;
|
| | 206 | end
|
| | 207 | end
|
| | 208 |
|
| | 209 | % Print out initial f(x) as 0th iteration
|
| 26 | 210 | if prnt == 3
|
| | 211 | disp(' ')
|
| | 212 | disp(header)
|
| | 213 | fprintf(' %5.0f %5.0f %12.6g %s\n', itercount, func_evals, fv(1), how);
|
| 26 | 214 | elseif prnt == 4
|
| | 215 | clc
|
| | 216 | formatsave.format = get(0,'format');
|
| | 217 | formatsave.formatspacing = get(0,'formatspacing');
|
| | 218 | % reset format when done
|
| | 219 | oc1 = onCleanup(@()set(0,'format',formatsave.format));
|
| | 220 | oc2 = onCleanup(@()set(0,'formatspacing',formatsave.formatspacing));
|
| | 221 | format compact
|
| | 222 | format short e
|
| | 223 | disp(' ')
|
| | 224 | disp(how)
|
| | 225 | v
|
| | 226 | fv
|
| | 227 | func_evals
|
| | 228 | end
|
| | 229 | % OutputFcn and PlotFcns call
|
| 26 | 230 | if haveoutputfcn || haveplotfcn
|
| | 231 | [xOutputfcn, optimValues, stop] = callOutputAndPlotFcns(outputfcn,plotfcns,v(:,1),xOutputfcn,'iter',itercount, ...
|
| | 232 | func_evals, how, fv(:,1),varargin{:});
|
| | 233 | if stop % Stop per user request.
|
| | 234 | [x,fval,exitflag,output] = cleanUpInterrupt(xOutputfcn,optimValues);
|
| | 235 | if prnt > 0
|
| | 236 | disp(output.message)
|
| | 237 | end
|
| | 238 | return;
|
| | 239 | end
|
| | 240 | end
|
| | 241 |
|
| | 242 | % Continue setting up the initial simplex.
|
| | 243 | % Following improvement suggested by L.Pfeffer at Stanford
|
| 26 | 244 | usual_delta = 0.05; % 5 percent deltas for non-zero terms
|
| 26 | 245 | zero_term_delta = 0.00025; % Even smaller delta for zero elements of x
|
| 26 | 246 | for j = 1:n
|
| 153 | 247 | y = xin;
|
| 153 | 248 | if y(j) ~= 0
|
| 153 | 249 | y(j) = (1 + usual_delta)*y(j);
|
| | 250 | else
|
| | 251 | y(j) = zero_term_delta;
|
| | 252 | end
|
| 153 | 253 | v(:,j+1) = y;
|
0.05 | 153 | 254 | x(:) = y; f = funfcn(x,varargin{:});
|
| 153 | 255 | fv(1,j+1) = f;
|
| 153 | 256 | end
|
| | 257 |
|
| | 258 | % sort so v(1,:) has the lowest function value
|
| 26 | 259 | [fv,j] = sort(fv);
|
| 26 | 260 | v = v(:,j);
|
| | 261 |
|
| 26 | 262 | how = 'initial simplex';
|
| 26 | 263 | itercount = itercount + 1;
|
| 26 | 264 | func_evals = n+1;
|
| 26 | 265 | if prnt == 3
|
| | 266 | fprintf(' %5.0f %5.0f %12.6g %s\n', itercount, func_evals, fv(1), how)
|
0.01 | 26 | 267 | elseif prnt == 4
|
| | 268 | disp(' ')
|
| | 269 | disp(how)
|
| | 270 | v
|
| | 271 | fv
|
| | 272 | func_evals
|
| | 273 | end
|
| | 274 | % OutputFcn and PlotFcns call
|
| 26 | 275 | if haveoutputfcn || haveplotfcn
|
| | 276 | [xOutputfcn, optimValues, stop] = callOutputAndPlotFcns(outputfcn,plotfcns,v(:,1),xOutputfcn,'iter',itercount, ...
|
| | 277 | func_evals, how, fv(:,1),varargin{:});
|
| | 278 | if stop % Stop per user request.
|
| | 279 | [x,fval,exitflag,output] = cleanUpInterrupt(xOutputfcn,optimValues);
|
| | 280 | if prnt > 0
|
| | 281 | disp(output.message)
|
| | 282 | end
|
| | 283 | return;
|
| | 284 | end
|
| | 285 | end
|
| 26 | 286 | exitflag = 1;
|
| | 287 |
|
| | 288 | % Main algorithm: iterate until
|
| | 289 | % (a) the maximum coordinate difference between the current best point and the
|
| | 290 | % other points in the simplex is less than or equal to TolX. Specifically,
|
| | 291 | % until max(||v2-v1||,||v3-v1||,...,||v(n+1)-v1||) <= TolX,
|
| | 292 | % where ||.|| is the infinity-norm, and v1 holds the
|
| | 293 | % vertex with the current lowest value; AND
|
| | 294 | % (b) the corresponding difference in function values is less than or equal
|
| | 295 | % to TolFun. (Cannot use OR instead of AND.)
|
| | 296 | % The iteration stops if the maximum number of iterations or function evaluations
|
| | 297 | % are exceeded
|
0.02 | 26 | 298 | while func_evals < maxfun && itercount < maxiter
|
0.25 | 14035 | 299 | if max(abs(fv(1)-fv(two2np1))) <= max(tolf,10*eps(fv(1))) && ...
|
| | 300 | max(max(abs(v(:,two2np1)-v(:,onesn)))) <= max(tolx,10*eps(max(v(:,1))))
|
| 23 | 301 | break
|
| | 302 | end
|
| | 303 |
|
| | 304 | % Compute the reflection point
|
| | 305 |
|
| | 306 | % xbar = average of the n (NOT n+1) best points
|
0.14 | 14012 | 307 | xbar = sum(v(:,one2n), 2)/n;
|
0.05 | 14012 | 308 | xr = (1 + rho)*xbar - rho*v(:,end);
|
2.26 | 14012 | 309 | x(:) = xr; fxr = funfcn(x,varargin{:});
|
0.03 | 14012 | 310 | func_evals = func_evals+1;
|
| | 311 |
|
0.05 | 14012 | 312 | if fxr < fv(:,1)
|
| | 313 | % Calculate the expansion point
|
0.01 | 2785 | 314 | xe = (1 + rho*chi)*xbar - rho*chi*v(:,end);
|
0.38 | 2785 | 315 | x(:) = xe; fxe = funfcn(x,varargin{:});
|
0.01 | 2785 | 316 | func_evals = func_evals+1;
|
| 2785 | 317 | if fxe < fxr
|
| 1504 | 318 | v(:,end) = xe;
|
0.01 | 1504 | 319 | fv(:,end) = fxe;
|
| 1504 | 320 | how = 'expand';
|
| 1281 | 321 | else
|
| 1281 | 322 | v(:,end) = xr;
|
| 1281 | 323 | fv(:,end) = fxr;
|
| 1281 | 324 | how = 'reflect';
|
| 1281 | 325 | end
|
0.01 | 11227 | 326 | else % fv(:,1) <= fxr
|
0.03 | 11227 | 327 | if fxr < fv(:,n)
|
0.01 | 7333 | 328 | v(:,end) = xr;
|
0.03 | 7333 | 329 | fv(:,end) = fxr;
|
0.06 | 7333 | 330 | how = 'reflect';
|
0.01 | 3894 | 331 | else % fxr >= fv(:,n)
|
| | 332 | % Perform contraction
|
0.02 | 3894 | 333 | if fxr < fv(:,end)
|
| | 334 | % Perform an outside contraction
|
| 514 | 335 | xc = (1 + psi*rho)*xbar - psi*rho*v(:,end);
|
0.04 | 514 | 336 | x(:) = xc; fxc = funfcn(x,varargin{:});
|
| 514 | 337 | func_evals = func_evals+1;
|
| | 338 |
|
| 514 | 339 | if fxc <= fxr
|
| 513 | 340 | v(:,end) = xc;
|
| 513 | 341 | fv(:,end) = fxc;
|
| 513 | 342 | how = 'contract outside';
|
| 1 | 343 | else
|
| | 344 | % perform a shrink
|
| 1 | 345 | how = 'shrink';
|
| 1 | 346 | end
|
0.01 | 3380 | 347 | else
|
| | 348 | % Perform an inside contraction
|
0.01 | 3380 | 349 | xcc = (1-psi)*xbar + psi*v(:,end);
|
0.42 | 3380 | 350 | x(:) = xcc; fxcc = funfcn(x,varargin{:});
|
| 3380 | 351 | func_evals = func_evals+1;
|
| | 352 |
|
| 3380 | 353 | if fxcc < fv(:,end)
|
0.01 | 3373 | 354 | v(:,end) = xcc;
|
| 3373 | 355 | fv(:,end) = fxcc;
|
0.01 | 3373 | 356 | how = 'contract inside';
|
| 7 | 357 | else
|
| | 358 | % perform a shrink
|
| 7 | 359 | how = 'shrink';
|
| 7 | 360 | end
|
0.02 | 3380 | 361 | end
|
| 3894 | 362 | if strcmp(how,'shrink')
|
| 8 | 363 | for j=two2np1
|
| 72 | 364 | v(:,j)=v(:,1)+sigma*(v(:,j) - v(:,1));
|
0.03 | 72 | 365 | x(:) = v(:,j); fv(:,j) = funfcn(x,varargin{:});
|
| 72 | 366 | end
|
| 8 | 367 | func_evals = func_evals + n;
|
| 8 | 368 | end
|
0.01 | 3894 | 369 | end
|
0.02 | 11227 | 370 | end
|
0.05 | 14012 | 371 | [fv,j] = sort(fv);
|
0.01 | 14012 | 372 | v = v(:,j);
|
0.02 | 14012 | 373 | itercount = itercount + 1;
|
0.01 | 14012 | 374 | if prnt == 3
|
| | 375 | fprintf(' %5.0f %5.0f %12.6g %s\n', itercount, func_evals, fv(1), how)
|
0.02 | 14012 | 376 | elseif prnt == 4
|
| | 377 | disp(' ')
|
| | 378 | disp(how)
|
| | 379 | v
|
| | 380 | fv
|
| | 381 | func_evals
|
| | 382 | end
|
| | 383 | % OutputFcn and PlotFcns call
|
0.01 | 14012 | 384 | if haveoutputfcn || haveplotfcn
|
| | 385 | [xOutputfcn, optimValues, stop] = callOutputAndPlotFcns(outputfcn,plotfcns,v(:,1),xOutputfcn,'iter',itercount, ...
|
| | 386 | func_evals, how, fv(:,1),varargin{:});
|
| | 387 | if stop % Stop per user request.
|
| | 388 | [x,fval,exitflag,output] = cleanUpInterrupt(xOutputfcn,optimValues);
|
| | 389 | if prnt > 0
|
| | 390 | disp(output.message)
|
| | 391 | end
|
| | 392 | return;
|
| | 393 | end
|
| | 394 | end
|
0.05 | 14012 | 395 | end % while
|
| | 396 |
|
| 26 | 397 | x(:) = v(:,1);
|
| 26 | 398 | fval = fv(:,1);
|
| | 399 |
|
| 26 | 400 | output.iterations = itercount;
|
| 26 | 401 | output.funcCount = func_evals;
|
| 26 | 402 | output.algorithm = 'Nelder-Mead simplex direct search';
|
| | 403 |
|
| | 404 | % OutputFcn and PlotFcns call
|
| 26 | 405 | if haveoutputfcn || haveplotfcn
|
| | 406 | callOutputAndPlotFcns(outputfcn,plotfcns,x,xOutputfcn,'done',itercount, func_evals, how, fval, varargin{:});
|
| | 407 | end
|
| | 408 |
|
| 26 | 409 | if func_evals >= maxfun
|
| | 410 | msg = getString(message('MATLAB:fminsearch:ExitingMaxFunctionEvals', sprintf('%f',fval)));
|
| | 411 | if prnt > 0
|
| | 412 | disp(' ')
|
| | 413 | disp(msg)
|
| | 414 | end
|
| | 415 | exitflag = 0;
|
| 26 | 416 | elseif itercount >= maxiter
|
| 3 | 417 | msg = getString(message('MATLAB:fminsearch:ExitingMaxIterations', sprintf('%f',fval)));
|
| 3 | 418 | if prnt > 0
|
| | 419 | disp(' ')
|
| | 420 | disp(msg)
|
| | 421 | end
|
| 3 | 422 | exitflag = 0;
|
| 23 | 423 | else
|
| 23 | 424 | msg = ...
|
| | 425 | getString(message('MATLAB:fminsearch:OptimizationTerminatedXSatisfiesCriteria', ...
|
| | 426 | sprintf('%e',tolx), sprintf('%e',tolf)));
|
| 23 | 427 | if prnt > 1
|
| | 428 | disp(' ')
|
| | 429 | disp(msg)
|
| | 430 | end
|
| 23 | 431 | exitflag = 1;
|
| 23 | 432 | end
|
| | 433 |
|
| 26 | 434 | output.message = msg;
|
Other subfunctions in this file are not included in this listing.