Azzera filtri
Azzera filtri

finding numerical integration of vectors

1 visualizzazione (ultimi 30 giorni)
Moli Wang
Moli Wang il 5 Mar 2017
Risposto: Torsten il 6 Mar 2017
I have two vectors and I want the numerical integration of the product of this two vectors from zero to infinity. For example, P=integral(A(u)B(u))du from 0 to infinity. A(u) and B(u) are vectors.
How can I do that? Can I use P=trapz(A(u).*B(u))?

Risposte (1)

Torsten
Torsten il 6 Mar 2017
P = trapz(U,AU.*BU);
where AU and BU are the vectors evaluated at U.
Best wishes
Torsten.

Community Treasure Hunt

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

Start Hunting!

Translated by