MATLAB求积分的数值解

2024-12-07 03:21:42
推荐回答(2个)
回答1:

用double() 化为数值型就可以了

>> syms x
y=inline('0.579/((2*pi*0.3176)^0.5*x^1.5)*exp(-(x-0.579)^2/(2*0.3176*x))','x');
A=int(x*exp(-3*x)*y(x),x,0,inf)
double(A)
Warning: Explicit integral could not be found.

A =

int(81487005757734912/(198810802005279125*x^(1/2)*exp(3*x)*exp((625*(x - 579/1000)^2)/(397*x))), x = 0..Inf)

ans =
0.0940
>>

回答2:

可以积分出来的,只是好像你的r和β怎么是反的:
clear all;clc;
syms x
r=0.3136;
beta=0.579;
y=r/((2*pi*beta)^0.5*x^1.5)*exp(-(x-r)^2/(2*beta*x));
s=int(x*exp(-3*x)*y,x,0,inf);
s=double(s)
s =

0.0810