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.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

`Nodes`

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.**

Optional | List of arithmetical expressions |

Objects | Nodes Default Values |
---|---|

`plot::Integral` | [`10` ] |

`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.

`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:

We request a specific division into subintervals:

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

The subintervals do not need to be of equal width:

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

delete f:

Was this topic helpful?