24小时热门版块排行榜    

查看: 426  |  回复: 3

bjwang

铁杆木虫 (正式写手)

[交流] 【求助】一个小程序--出现错误 已有2人参与

求助一个小程序--出现错误
function mc()
clc
syms x y
m=vpa(int(int(exp(-(x+y.^2)),'y',0,sqrt(1-x^2)),'x',0,1))
mx=vpa(int(int(x*exp(-(x+y.^2)),'y',0,sqrt(1-x^2)),'x',0,1))
my=vpa(int(int(y*exp(-(x+y.^2)),'y',0,sqrt(1-x^2)),'x',0,1))
xo=mx/m
yo=my/m
end
运行出现:Warning: Explicit integral could not be found.  

命令行单独运行>>>> int(exp(-(x+y.^2)),'y',0,sqrt(1-x^2))

ans =

(pi^(1/2)*erf((1 - x^2)^(1/2)))/(2*exp(x))
出现 erf???????????????,如何解决??谢谢!!!!
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

It is a shame for the soul to be first to give way in this life,when thy body does not give way.
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lijinfeng042

木虫 (小有名气)

Matlab

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
nono2009(金币+1):鼓励应助。 2010-10-23 06:40:58
引用回帖:
Originally posted by bjwang at 2010-10-22 19:22:28:
求助一个小程序--出现错误
function mc()
clc
syms x y
m=vpa(int(int(exp(-(x+y.^2)),'y',0,sqrt(1-x^2)),'x',0,1))
mx=vpa(int(int(x*exp(-(x+y.^2)),'y',0,sqrt(1-x^2)),'x',0,1))
my=vpa(int(int(y*exp ...

Warning: Explicit integral could not be found. 表明没有解析解 也就是精确解 只能求出数值解 vpa就是对符号表达式进行数值计算 单独得到的就是精确度 erf是误差函数 是一个积分....没有错的
工作了,偶尔会上来~可以关注新浪微博 @云是风的梦_Matlab
2楼2010-10-22 22:24:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

bjwang

铁杆木虫 (正式写手)

引用回帖:
Originally posted by lijinfeng042 at 2010-10-22 22:24:03:

Warning: Explicit integral could not be found. 表明没有解析解 也就是精确解 只能求出数值解 vpa就是对符号表达式进行数值计算 单独得到的就是精确度 erf是误差函数 是一个积分....没有错的

谢谢兄弟的回复,你的意思这个警告不影响结果?也就是结果是对的?
我运行的结果如下:
Warning: Explicit integral could not be found.  

m =

0.41885790884935676089988758402134

Warning: Explicit integral could not be found.  

mx =

0.15619470837673086802804878320116


my =

0.15991885983872689564729127550954


xo =

0.372906193429205761724598105422


yo =

0.38179739825861111387290068646833
It is a shame for the soul to be first to give way in this life,when thy body does not give way.
3楼2010-10-23 12:47:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

lijinfeng042

木虫 (小有名气)

Matlab


小木虫(金币+0.5):给个红包,谢谢回帖交流
引用回帖:
Originally posted by bjwang at 2010-10-23 12:47:42:

谢谢兄弟的回复,你的意思这个警告不影响结果?也就是结果是对的?
我运行的结果如下:
Warning: Explicit integral could not be found.  

m =

0.41885790884935676089988758402134

Warning: Ex ...

恩 不影响 只是为了说明 积分 int没有找到解析解 这是int函数定义里面的警告
工作了,偶尔会上来~可以关注新浪微博 @云是风的梦_Matlab
4楼2010-10-23 13:50:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 bjwang 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见