How to write integral equation ?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Michael Crown
el 5 de Sept. de 2020
Respondida: Michael Crown
el 10 de Sept. de 2020
I like to check if my code represent the equation. Please help
10 comentarios
Respuesta aceptada
David Hill
el 5 de Sept. de 2020
Not sure if your Ca is sorted. Yes, you have a stream of data that is being integrated. The proper function is trapz(). Providing your full code helped significantly. I assume you want your data sorted before integrating.
[Ca,idx]=sort(dataB(:,1));
Da=dataB(:,2);
Da=Da(idx);%aligns Da to sorted Ca
DaveA=trapz(Ca,Da)/(Ca(end)-Ca(1));
8 comentarios
Más respuestas (3)
Ver también
Categorías
Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!