How can I calculate a Integral.

1 次查看(过去 30 天)
Hello , and thanks for reading my question.
The problem is, i have a vector Error = [] , 60 values between 0 and 1 . I have another array that represents time . Time = [1,2,3...60]
I need to calculate the integral between 0 and 60 off Error(Time) dr;
How can i do this ?

采纳的回答

Titus Edelhofer
Titus Edelhofer 2015-6-9
Hi,
use the trapz function:
trapz(Time, Error)
Titus

更多回答(1 个)

Torsten
Torsten 2015-6-9
integral = error(1)/2 + sum(error(2:59)) + error(60)/2.
Best wishes
Torsten.

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by