How to take integral with for loop?

조회 수: 5 (최근 30일)
Arya Akhtar
Arya Akhtar 2021년 5월 24일
댓글: Arya Akhtar 2021년 5월 25일
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?

채택된 답변

Alan Stevens
Alan Stevens 2021년 5월 25일
Add the command
I = sum(final);
after the loop.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by