Integration of numerical data
이전 댓글 표시
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?

답변 (2개)
John D'Errico
2019년 5월 27일
0 개 추천
Multiply the two vectors. Then call trapz.
Star Strider
2019년 5월 27일
0 개 추천
For vectors of data, the best option would be the trapz (link) or the related cumtrapz functions, depending on the result you want.
댓글 수: 1
Abdul Basith Ashraf
2020년 8월 31일
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?
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!