Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 Middle Riemann sums for x from 0 to 1. rsums(f) displays a graph of f(x) using 10 terms (rectangles). You can adjust the number of terms taken in the Middle Riemann sum by using the slider below the graph. The number of terms available ranges from 2 to 128. f can be a character vector or a symbolic expression. The height of each rectangle is determined by the value of the function in the middle of each interval.

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

Examples

expand all

Use rsums(exp(-5*x^2)) to create the following plot.

syms x
rsums(exp(-5*x^2))

Introduced before R2006a

Was this topic helpful?