关于fminbnd求极值的问题
程序:syms x1 x2 alfa
y=x1+4*x2;
t=4+2*alfa;
z=subs(y,{x1,x2},{t,t})
[zx]=fminbnd(char(z),0,10)
运行后的错误提示是:
??? Error using ==> inlineeval at 15
Error in inline expression ==> 10*alfa + 20
Undefined function or variable 'alfa'.
Error in ==> inline.subsref at 27
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in ==> fminbnd at 212
x= xf; fx = funfcn(x,varargin{:});
Error in ==> lizi_niniudun_1 at 24
[zx]=fminbnd(char(z),0,10)
请问一下这是怎么回事?