Filter löschen
Filter löschen

How to pass extra parameters to multistart?

1 Ansicht (letzte 30 Tage)
Alex
Alex am 8 Mär. 2015
Beantwortet: Alex am 8 Mär. 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, ...

Akzeptierte Antwort

Alex
Alex am 8 Mär. 2015
the simple solution was to declare those variables inside the function

Weitere Antworten (0)

Kategorien

Mehr zu Global or Multiple Starting Point Search finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by