数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 3111|回复: 2

关于 sym 的问题,很简单的!请进!

[复制链接]
发表于 2003-8-14 03:00:19 | 显示全部楼层 |阅读模式
问你一个问题,对于下面的程序
fn='2*exp(-x)*sin(x)';
xmin=fmin(fn,0,5)
是可以得到结果的,但是为什么将第一行改成  f=sym('2*exp(-x)*sin(x)');之后就不可以了,为何?
发表于 2003-8-17 03:46:57 | 显示全部楼层
X = FMIN('F',x1,x2) attempts to return a value of x which is a local
   minimizer of F(x) in the interval x1 < x < x2.  

'2*exp(-x)*sin(x)' is a string containing the name of the objective function to be minimized.
发表于 2003-8-17 03:49:30 | 显示全部楼层
But sym('2*exp(-x)*sin(x)') is only a symbol, not a string.
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-4-19 08:56 , Processed in 0.051718 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表