# How to integrate given the two data columns

4 vues (au cours des 30 derniers jours)
Grigorios Chatziandreou le 29 Avr 2022
Hello. I have used ode45 to figure out current wrt time.
I have my matrix tz and my matrix CURRENT for values of current with time from tz(1)=0 to tz(end). How can I intagrate it? Any clever way if I do not know the time step in tz?
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (2)

Riccardo Scorretti le 29 Avr 2022
Most probably like this:
CHARGE = sum(CURRENT(1:end-1) .* diff(tz));
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Riccardo Scorretti le 29 Avr 2022
Something better can be done, but if you have a large number of points, it will give more or less the same result.

Connectez-vous pour commenter.

Torsten le 29 Avr 2022
dz/dt = CURRENT, z(t0) = 0
z will automatically be the integrated CURRENT over time.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Programming dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by