필터 지우기
필터 지우기

How to pass extra parameters to multistart?

조회 수: 1 (최근 30일)
Alex
Alex 2015년 3월 8일
답변: Alex 2015년 3월 8일
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