Effacer les filtres
Effacer les filtres

How to pass extra parameters to multistart?

1 vue (au cours des 30 derniers jours)
Alex
Alex le 8 Mar 2015
Réponse apportée : Alex le 8 Mar 2015
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, ...

Réponse acceptée

Alex
Alex le 8 Mar 2015
the simple solution was to declare those variables inside the function

Plus de réponses (0)

Catégories

En savoir plus sur Global or Multiple Starting Point Search dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by