Issue with integration using trapz

1 visualización (últimos 30 días)
Rahul
Rahul el 23 de Abr. de 2024
Comentada: Mathieu NOE el 24 de Abr. de 2024
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 comentarios
Torsten
Torsten el 23 de Abr. de 2024
To avoid the loop, you can use "cumtrapz" instead of "trapz".
Mathieu NOE
Mathieu NOE el 24 de Abr. de 2024
problem solved ?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by