- function [c,g]=fun2(x)
- c1=x(1)-x(2);
- c2=25-(+(atan(-(x(2)^2-x(1)^2)^0.5/x(1))));
- c3=17*x(2)-x(2)^2+x(1)^2;
- c4=3*x(1)*x(2)-x(1)^2-x(2)^2;
- c5=41/48*(x(1)^2+x(2)^2)-1.25*(x(2)-x(1))^2;
- c6=0.4*(x(1)+x(2))^2-41/48*(x(1)^2+x(2)^2);
- fun=int((x(1)^2+x(2)^2)/(x(1)^2+x(2)^2-2*x(1)*x(2)*cos(25*pi*t/3)),t,11/75,6/25);
- c7=fun*1000*41/48-0.06;
- g=[];
复制代码
这是我写的函数.运行后老是这样:
??? Error using ==> fmincon
FMINCON cannot continue because user supplied nonlinear constraint function
failed with the following error:
Undefined function or variable 't'.
Error in ==> D:\matlab\优化\tuoyuanyouhua.m
On line 3 ==> [x,y]=fmincon(@fun1,x0,[],[],[],[],[],[],nonlcon)
>>
|