Integration of numerical data

6 visualizaciones (últimos 30 días)
Emil Frøen
Emil Frøen el 26 de Mayo de 2019
Comentada: Abdul Basith Ashraf el 31 de Ag. de 2020
I have a set of numerical data stored in a vector D, and a second vector of positions z, of equal length.
If i wish to calculate the integral shown in the picture, how would this be done?
Equation.png

Respuestas (2)

John D'Errico
John D'Errico el 27 de Mayo de 2019
Multiply the two vectors. Then call trapz.

Star Strider
Star Strider el 27 de Mayo de 2019
For vectors of data, the best option would be the trapz (link) or the related cumtrapz functions, depending on the result you want.
  1 comentario
Abdul Basith Ashraf
Abdul Basith Ashraf el 31 de Ag. de 2020
I have not so regular data (x and y are returned from ode45).
How can I visualize the rectangles under the curve to see how good trapz is doing?

Iniciar sesión para comentar.

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!

Translated by