FMINUNC cannot continue help?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to learn how to use fminunc, but it gives the error "Failure in initial objective function evaluation. FMINUNC cannot continue."
Help please?
Note: Updated
for i = 1:modes
params.x0 = [y0 dy0];
params.xp = xspan;
fobj = @(beta)myobj(beta, params);
for j = 1:1000 % begin convergence loop for beta
beta = fminunc(fobj, beta0); % run optimization
end % end convergence loop
end
%%
function [err, T, Y] = myobj(beta)
x0 = params.x0;
xspan = params.xp;
[T,Y] = ode45('ffunc', xspan, x0);
err = abs(Y(end,2) + sqrt(K*L.^2 - beta)*Y(end,1)); % error
end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Propagation and Channel Models についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!