I want to integrate this function

1 次查看(过去 30 天)
x=0:50;
y=exp(-x./25).*sqrt((25+x)/(25-x));
int(y,x,0,50)
i want to integrate this function

采纳的回答

Star Strider
Star Strider 2022-3-20
Use the integral function —
x = 0:50;
y = @(x) exp(-x./25).*sqrt((25+x)/(25-x));
int_y = integral(y,0,50)
int_y = 0.0000 + 21.6166i
The cumtrapz (or trapz) function is another option:
x = 0:50;
y = @(x) exp(-x./25).*sqrt((25+x)/(25-x));
int_y = cumtrapz(x,y(x));
figure
plot(x, real(int_y), x,imag(int_y))
grid
legend('Real','Imaginary', 'Location', 'best')
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by