我们使用自定义的牛顿 - 拉夫逊函数,并希望使用该函数的全局和多搜索功能。其实这个问题是无法理解的[b,fval,exitflag,output,solutions]
Matlab优化功能
x=11;
[email protected];
gs=GlobalSearch;
[b,fval,exitflag,output,solutions]=run(gs,problem);
值 -
function NR1()
% x0=0.1;
iter=0;
while abs(f(x0))>1e-2
x1=x0-f(x0)/fprime(x0)
x0=x1;
iter=iter+1
end
end
function out=f(in)
out=in^2-1;
end
function out=fprime(in)
out=2*in;
end
你确定你可以使用带有2个参数的'run'吗? –
是的,我们知道通常“运行”命令在全局搜索中需要2个参数,但在多重启动时需要3个参数。你有任何知识,如何设置这些变量[b,fval,exitflag,输出,解决方案] – Rose