필터 지우기
필터 지우기

I want to integrate this function

조회 수: 2 (최근 30일)
khaled Abdelghafar
khaled Abdelghafar 2022년 3월 20일
답변: Star Strider 2022년 3월 20일
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