Octave compatibility fix: the 3rd output argument to fminsearch was added in Octave 4.4

mr#2134
Sébastien Villemot 2023-04-17 13:39:42 +02:00
parent 873685e7e6
commit e413696277
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 2 deletions

View File

@ -353,9 +353,9 @@ switch minimizer_algorithm
[opt_par_values,fval,exitflag] = fminsearch(objective_function,start_par_value,optim_options,varargin{:});
else
% Under Octave, use a wrapper, since fminsearch() does not have a
% 4th arg, and only has two output args
% 4th arg.
func = @(x) objective_function(x,varargin{:});
[opt_par_values,fval] = fminsearch(func,start_par_value,optim_options);
[opt_par_values,fval,exitflag] = fminsearch(func,start_par_value,optim_options);
end
case 8
% Dynare implementation of the simplex algorithm.