Skip to content
Snippets Groups Projects
Verified Commit 03641585 authored by Willi Mutschler's avatar Willi Mutschler
Browse files

:white_check_mark: Fix lsqnonlin in Octave

parent 25f1641d
No related branches found
No related tags found
1 merge request!1783Fix lsqnonlin in Octave
...@@ -537,7 +537,13 @@ switch minimizer_algorithm ...@@ -537,7 +537,13 @@ switch minimizer_algorithm
if options_.silent_optimizer if options_.silent_optimizer
optim_options = optimset(optim_options,'display','off'); optim_options = optimset(optim_options,'display','off');
end end
if ~isoctave
[opt_par_values,Resnorm,fval,exitflag,OUTPUT,LAMBDA,JACOB] = lsqnonlin(objective_function,start_par_value,bounds(:,1),bounds(:,2),optim_options,varargin{:}); [opt_par_values,Resnorm,fval,exitflag,OUTPUT,LAMBDA,JACOB] = lsqnonlin(objective_function,start_par_value,bounds(:,1),bounds(:,2),optim_options,varargin{:});
else
% Under Octave, use a wrapper, since lsqnonlin() does not have a 6th arg
func = @(x)objective_function(x,varargin{:});
[opt_par_values,Resnorm,fval,exitflag,OUTPUT,LAMBDA,JACOB] = lsqnonlin(func,start_par_value,bounds(:,1),bounds(:,2),optim_options);
end
otherwise otherwise
if ischar(minimizer_algorithm) if ischar(minimizer_algorithm)
if exist(minimizer_algorithm) if exist(minimizer_algorithm)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment