0
$\begingroup$

I am trying to implement this equation on Matlab, where i have wj values in the form of an array, cumtrapz command of MATLAB implements this, but its confusing which way is exact. such as cumtrapz(t,wj) or simply cumtrapz(wj) or manually doing it? Because results of all these though related, are different.

$\endgroup$
0
$\begingroup$

If $\omega$ is a vector with all the discrete elements $\omega_{j}$ over the descrete time steps $dt$ the correct formula would be dt*cumtrapz(omega); which is the same as cumtrapz(dt,omega) or alternatively if $dt$ isn't constant but $t$ is a vector with evaluation positions Omega=cumtrapz(t,omega,2). The "2" is needed to indicate that the 2nd vector should be integrated. Function omega and its integration using cumtrapz

$\endgroup$
2
  • $\begingroup$ I have 't' values in a 1d array, and omega values at each time point 't' in another. $\endgroup$ – Khan Apr 12 at 12:57
  • $\begingroup$ Then cumtrapz(t,omega,2) is the way to go $\endgroup$ – Matthias La Apr 12 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.