Using trapz function to find area of two vectors

2 visualizaciones (últimos 30 días)
Ajay Paudyal
Ajay Paudyal el 13 de Feb. de 2018
Respondida: Star Strider el 13 de Feb. de 2018
I have one vector named 'Power' having 300 values and 'time' vector with 300 values. I want to integrate them so as to get energy(Area under Power and Time). How to use trapz for this? If trapz cannot be used then please let me know any other method.

Respuestas (1)

Star Strider
Star Strider el 13 de Feb. de 2018
Try this:
Work = trapz(Time, Power)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by