作业帮 > 综合 > 作业

matlab计算erfc积分的问题(急!)

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/08 06:45:00
matlab计算erfc积分的问题(急!)

想用MATLAB计算上式
我在MATLAB中写的是

L=0.482208146  %diffusion layer
D=1e-3         %diffusion coefficient   
syms y x t a;       
y=erfc(L/2*sqrt(D*x))*exp(a*(x-t));  % the function that is integrated
nt(y,x,0,t)      %function above is integrated from 0 to t但
是运行时候显示? Undefined function or method 'erfc' for input arguments of type 'sym'.
erfc要求数据是实数,MATLAB默认syms是复数形势,所以不适用;syms x real 就能把x定义为实数了,这样应该就可以了,t,a类似
再问: 谢谢,我按照您的方法试了一下,还是显示??? Undefined function or method 'erfc' for input arguments of type 'sym' 您能帮我再想想办法吗? 太感谢了
再答: 不好意思,昨天没有仔细看,你可以把erfc展开,erfc不针对变量求解,展开后可以将双重积分变为两个单积分,然后就容易了,我试了下,可行