rsums - Interactive evaluation of Riemann sums

Syntax

rsums(f)
rsums(f,a,b)
rsums(f,[a,b])

Description

rsums(f) interactively approximates the integral of f(x) by Riemann sums from 0 to 1. rsums(f) displays a graph of f(x). You can then adjust the number of terms taken in the Riemann sum by using the slider below the graph. The number of terms available ranges from 2 to 128. f can be a string or a symbolic expression.

rsums(f,a,b) and rsums(f,[a,b]) approximates the integral from a to b.

Examples

Either rsums('exp(-5*x^2)') or rsums exp(-5*x^2) creates the following plot.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS