Sum of rectangle function
이전 댓글 표시
Hello, how can I create a sum of rectangles?
댓글 수: 1
Ameer Hamza
2020년 11월 1일
What do you mean by sum of rectangles?
답변 (1개)
Ameer Hamza
2020년 11월 1일
If by "sum of rectangles" you mean Riemann sum approximation of integral using rectangles, then use cumsum(): https://www.mathworks.com/help/matlab/ref/cumsum.html. For example
t = 0:0.1:10;
y = t.^2;
I = cumsum(y).*gradient(t);
댓글 수: 5
Amir Delavari
2020년 11월 1일
Ameer Hamza
2020년 11월 1일
Can you show the mathematical formula for the function?
Amir Delavari
2020년 11월 1일
Ameer Hamza
2020년 11월 2일
How the rect() function is defined?
Amir Delavari
2020년 11월 2일
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
