dealing with the offset - cumtrapz
4 次查看(过去 30 天)
显示 更早的评论
I am using cumtrapz which requires an equally spaced dataset in order to carry out integration. I pick the value closet to zero in order to begin my integration however I was wondering how do I correct for the slight offset so that my integration avoids accumulating error. I tried interpolation but it didnt fit with cumtrapz very neatly.
0 个评论
回答(2 个)
Matt J
2015-1-23
I am using cumtrapz which requires an equally spaced dataset in order to carry out integration.
Not sure what you mean by that. CUMTRAPZ supports the syntax
Z = cumtrapz(X,Y)
which allows you to specify non-uniformly spaced X.
0 个评论
Christian R.
2019-2-20
In an integration if the steps are close enough the error will decrease, then, you must decrease the step of the vector the smaller the better but the slower it runs because of more points to compute. (try 1e-4 it might work).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!