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.


Number of subintervals or list of x-values for subintervals

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

OptionalList of arithmetical expressions

Graphics Primitives

ObjectsNodes Default Values


Nodes is a positive number of subintervals for numeric approximation of integrals. The given interval for approximation is divided into the given number of subintervals, all of the same width.

Otherwise, Nodes can be a list of x-values for dividing the given interval. The interval is divided into subintervals at the given x-values.

When a number is given for Nodes, the number can be given as a list with this one number, too.

When a list with x-values is given, the left and right border of the whole (approximation) interval can be omitted. In this case, the number of subintervals is the number of given x-values plus one.

Nodes outside the approximation interval are ignored. Duplicate values are ignored.

The nodes need not be ordered.


Example 1

Nodes determines the number of rectangles for Riemann sums:

f := plot::Function2d(x*(x+4)*(x-4)):
plot(plot::Integral(f, Nodes = 25, IntMethod = RiemannLower), f)

Increasing of Nodes decreases the error or the approximation:

plot(plot::Integral(f, Nodes = 125, IntMethod = RiemannLower), f)

delete f:

Example 2

We request a specific division into subintervals:

f := plot::Function2d(sin(x), x = -2*PI..2*PI):
  plot::Integral(f, Nodes = [i*PI/2 $ i = -4..4],
                    IntMethod = Trapezoid),

The subintervals do not need to be of equal width:

f := plot::Function2d(sin(x), x = 0..PI):
  plot::Integral(f, [PI/3, PI/2, 2*PI/3],
                  IntMethod = Trapezoid),

delete f:

See Also

MuPAD Functions

Was this topic helpful?