MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 求助关于fminbnd求极值的问题 (https://www.labfans.com/bbs/showthread.php?t=20855)

bleeze2010 2015-10-12 17:28

求助关于fminbnd求极值的问题
 
[SIZE="6"][SIZE="4"]程序:
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)[/SIZE]
[/SIZE]
[COLOR="Red"]运行后的错误提示是:[/COLOR]
??? 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)

请问一下这是怎么回事?


所有时间均为北京时间。现在的时间是 12:34

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.