<P>clear all;<BR>function f = fun61(x)<BR>f=-3000*x(1)-4500*x(2)-6500*x(3);</P>
<P>%不等式约束<BR>A=[20 25 35;120 150 170;30 40 50];<BR>b=[3000;20000;4500];<BR>%等式约束<BR>Aeq=[1 1 1];<BR>beq=[100];<BR>%边界约束<BR>lb=[0;0;0];<BR>ub=[100;100;100];<BR>%标准算法<BR>options=optimset('largescale','off');<BR>%初始点<BR>x0=[30 30 40];<BR>%优化函数调用<BR>[x,fval]=fmincon('fun61',x0',x0,A,b,Aeq,beq,lb,ub,[],options);<BR><BR>运行显示<BR>Error: The input character is not valid in MATLAB statements or expressions.<BR>请各位高手帮帮小弟</P>
虽然问题很菜但是还望高手不吝赐教,应为小弟我现在很急啊<BR><BR>还有即使我输入<BR>function f = fun61(x)<BR>都提示出错<BR>Error: Function definitions are not permitted at the prompt or in scripts.