Issue with integration using trapz

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 个评论

we cannot run your code
please provide the missing data (X, jd0,...)
what is the expected result ?
To avoid the loop, you can use "cumtrapz" instead of "trapz".

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

产品

版本

R2023a

标签

提问:

2024-4-23

Community Treasure Hunt

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

Start Hunting!

Translated by