a=get(handles.edit1,'String');
s=get(handles.edit2,'String');
c=get(handles.edit3,'String');
d=get(handles.edit5,'String');
e=get(handles.edit6,'String');
f=get(handles.edit11,'String');
g=get(handles.edit12,'String');
fun=@(x,y)ax+sy+c;
objfun=@(x)fun(x(1),x(2));
x0=[0 0];
A = [];
b = [];
Aeq = [];
beq = [];
lb=[d,f];
ub=[e,g];
[x,fval]=fmincon(objfun,x0,A,b,Aeq,beq,lb,ub);
set(handles.edit4,'String',fval);
出错提示我
FMINCON requires the following inputs to be of data type double: 'LB','UB'.
实在不明白了,请问应该怎么修改呀?
尝试使用 str2double函数作用到dfeg上