计算中这样的bug!# Computation - 科学计算
g*i
1 楼
大家不妨copy下面两行matlab语句到matlab6.0分别执行一下,
看结果是否相同
dblquad('0.5/pi *cos(x).^3.*cos(y).^4 .* (sin(x).^2.*cos(y).^2+sin(y).^2)',
-pi/2,pi/2,-pi/2,pi/2)*2*3
dblquad('0.5/pi *cos(x).^3.*cos(p).^4 .* (sin(x).^2.*cos(p).^2+sin(p).^2)',
-pi/2,pi/2,-pi/2,pi/2)*2*3
然后看看这两行语句究竟有什么不同?
难道是我的系统有问题?
这么个古怪的bug害惨我了
你也可以试着用函数,呵呵,又有新的bug来了
看结果是否相同
dblquad('0.5/pi *cos(x).^3.*cos(y).^4 .* (sin(x).^2.*cos(y).^2+sin(y).^2)',
-pi/2,pi/2,-pi/2,pi/2)*2*3
dblquad('0.5/pi *cos(x).^3.*cos(p).^4 .* (sin(x).^2.*cos(p).^2+sin(p).^2)',
-pi/2,pi/2,-pi/2,pi/2)*2*3
然后看看这两行语句究竟有什么不同?
难道是我的系统有问题?
这么个古怪的bug害惨我了
你也可以试着用函数,呵呵,又有新的bug来了