フィルターのクリア

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 Center および File ExchangeGlobal 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