How to take integral with for loop?

4 vues (au cours des 30 derniers jours)
Arya Akhtar
Arya Akhtar le 24 Mai 2021
Commenté : Arya Akhtar le 25 Mai 2021
Hello,
I would like to integrate my function with for loop.
for l = 1: length(x)-1
final(l) = (upper(i+1)-upper(i)).*(w(2)-w(1)) ;
end
where x is my function and l is my time. i cannot have desired output. how can i do that?

Réponse acceptée

Alan Stevens
Alan Stevens le 25 Mai 2021
Add the command
I = sum(final);
after the loop.
  1 commentaire
Arya Akhtar
Arya Akhtar le 25 Mai 2021
Thank you sir!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differentiation 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