problem using trapz function
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
can someone help me figure out how to use the trapz function to find the area under the curve for a graph of for example Y=[1 3 5 9 15] versus t =[0 14 28 35 42] respectively? over the time intervals 0-14,14-28,28-35,35-42. to clarify i'm wondering how one specifies in the trapz funtion to take the area under the curve of a matrix over variable intervals. I've tried trapz(t,Y) but it doesn't work. any help would be greatly appreciated.
0 comentarios
Respuestas (1)
Star Strider
el 28 de Abr. de 2017
See if the cumtrapz function does what you want:
z = cumtrapz(t,Y)
It takes the cumulative integrals over each ‘t’ interval.
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!