Issue with integration using trapz

조회 수: 1 (최근 30일)
Rahul
Rahul 2024년 4월 23일
댓글: Mathieu NOE 2024년 4월 24일
Hello,
I'm trying to implement integration using trapz. But the resultant quantity after integration is negligibly small and doesn't increment. Am I doing something wrong which is confusing me.
Can you see and advice me the chnages if any.
num=15;
Iq(1)=eps;
for i=2:11
Iq(i)=trapz(X(1:i),X(1:i).*jd0.*(1-(X(1:i)-x0).^2).^num);
end
Here, x0=1
rgds,
rc
  댓글 수: 3
Torsten
Torsten 2024년 4월 23일
To avoid the loop, you can use "cumtrapz" instead of "trapz".
Mathieu NOE
Mathieu NOE 2024년 4월 24일
problem solved ?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by