请问这段代码该如何修改呢?
主函数代码:
y=[1393,375,259,987];
theta=[161.2,45.1,-51];
sigma=[0.8,0.6,1.3];
d4=864.3;
sigma4=2;
x0=[900,700];
nonlcon = @circlecon;
options = optimoptions('fmincon','Display','iter','Algorithm','sqp');
[x,fval]=fmincon('fun',x0,[],[],[],[],[],[],nonlcon,options);
fun函数代码:
f=((atan2(x-x(1),y-y(1))-theta(1))/sigma(1)).^2+...
((atan2(x-x(2),y-y(2))-theta(2))/sigma(2)).^2+...
((atan2(x-x(3),y-y(3))-theta(3))/sigma(3)).^2+...
((d4-sqrt((x-x(4)).^2+(y-y(4)).^2))/sigma4).^2
错误代码:
Failure in initial objective function evaluation. FMINCON cannot continue.
问题描述: