jeudi 12 octobre 2017

Equivalent to cumtrapz in c++

What is equivalent to below code in c++?

cdf  = cumtrapz(t, P); 

P and t are 1000 by 1 vectors.

from matlab help: cumtrapz(X,Y) computes the cumulative integral of Y with respect to X using trapezoidal integration. X and Y must be vectors of the same length, or X must be a column vector and Y an array whose first nonsingleton dimension is length(X). cumtrapz operates across this dimension. Inputs X and Y can be complex.

Aucun commentaire:

Enregistrer un commentaire