How to pass extra parameters to multistart?

3 次查看(过去 30 天)
I was able to optimize a local solver with a few extra parameters after options (pulse_method, etc.) as follows:
options = optimset('MaxFunEvals', 1000000, 'MaxIter', 1000000, 'TolFun',1e-16,'TolX',1e-16, 'Display', 'off' );
[x,resnorm,residual,exitflag,output,lambda,jacobian] = lsqcurvefit(@cest_sim_slave, x0, offset_w, data(:,2), lb,ub, options ,pulse_method, cwpe_approximation, sampling, ...
fs, B1amp, pulse_duration, pulse_interval, spoiler, pulse_repeat, dummy, recovery, pulse_sampling_factor);
Now I'm trying to pass the same extra parameters after opt (pulse_method, etc.) to multistart:
opts = optimoptions(@lsqcurvefit,'TolFun',1e-16,'TolX',1e-16, 'Display', 'off');
problem = createOptimProblem('lsqcurvefit','objective',@cest_sim_slave,'x0',x0,'xdata',offset_w,'ydata',data(:,2),'lb',lb,'ub',ub,'options', opts ,pulse_method, cwpe_approximation, sampling, ...
fs, B1amp, pulse_duration, pulse_interval, spoiler, pulse_repeat, dummy, recovery, pulse_sampling_factor);
%matlabpool open 4
ms = MultiStart;
[x fval eflag output manymins] = run(ms,problem,50);
%matlabpool close
and I'm getting the error bellow. What am I doing wrong?
Error using createOptimProblem (line 102) No field long exists for PROBLEM structure. Type "help createOptimProblem" for a list of valid fields for each solver. Error in fit (line 40) problem = createOptimProblem('lsqcurvefit','objective',@cest_sim_slave,'x0',x0,'xdata',offset_w,'ydata',data(:,2),'lb',lb,'ub',ub,pulse_method, cwpe_approximation, sampling, ...

采纳的回答

Alex
Alex 2015-3-8
the simple solution was to declare those variables inside the function

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Global or Multiple Starting Point Search 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by