M文件是function [c,ceq]=mycon(x)c=[];ceq=[x(1)*x(4)-x(2)*x(3);x(1)*x(8)-x(2)*x(7)];下面是解得过程:ffun='6*x(1)+6*x(2)+16*x(3)+16*x(4)+10*x(5)+10*x(6)+15*x(7)+15*x(8)';A=[0.5/100 0 -1.5/100 0 -0.5/100 0 -1.5/100 0 ; 0 1.5/100 0 -0.5/100 0 0.5/100 0 -0.5/100 ; 0 0 0 0 0 0 1 1 ; -1 0 -1 0 -1 0 -1 0 ; 0 -1 0 -1 0 -1 0 -1];b=[0;0;50;-100;-200];x0=[0,10];Aeq=[ ];beq=[ ];lb=zeros(8,1);ub=[ ];[x,fval,h]=fmincon(@ ffun,x0,A,b,Aeq,beq,lb,ub,@ mycon)??? Error: "ffun" was previously used as a variable, conflicting with its use here as the name of a function or command. See MATLAB Programming, "How MATLAB Recognizes Function Calls That Use Command Syntax" for details.请问问题出在哪啊?能给答案最好,谢谢了。
|