liusing 发表于 2011-4-10 14:49:36

如何解带gamma函数的方程

gamma(1.5)=0.8862;
为何x= solve('gamma(x)=0.8862')

x =

-1.6358631006035320454282781618422-.51160467566396492912690016898762*i

liusing 发表于 2011-4-10 15:52:30

1# liusing
这样可以,但是不知道为什么?
options=optimset('Display','iter','TolFun',1e-10);   % Option to display output
mef=1.5;
x0=2;
x=fsolve(@(x) gamma(1+2./x)/((gamma(1+1./x))^2)-(2.*gamma(1+2./mef)/((gamma(1+1./mef))^2)-1.),x0,options)

千亿星辰 发表于 2011-4-11 09:09:01

请问在x=fsolve(@(x) gamma(1+2./x)/((gamma(1+1./x))^2)-(2.*gamma(1+2./mef)/((gamma(1+1./mef))^2)-1.),x0,options)中,(@(x) 是啥意思啊?有啥用啊

shamohu 发表于 2011-4-11 09:09:27

'gamma(x)=0.8862'应该有两个实数解吧:
x: 1.42453071908682

x: 1.49915829364734

qibbxxt 发表于 2011-4-11 13:18:03

3# 千亿星辰
fsolve的第一个输入参数,是函数的句柄
@是用过构造匿名函数的
页: [1]
查看完整版本: 如何解带gamma函数的方程