# Documentation

### This is machine translation

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

# `numeric`::`ncdata`

Weights and abscissae of Newton-Cotes quadrature

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

## Syntax

```numeric::ncdata(`n`)
```

## Description

`numeric::ncdata(n)` returns the weights and the abscissae of the Newton-Cotes quadrature rule with n equidistant nodes.

The Newton-Cotes quadrature rule produces the exact integral for all polynomials f through degree n - 1. If n is odd, then the quadrature rule is exact through degree n.

The equidistant abscissae c = [c1, …, cn] are given by .

## Environment Interactions

`numeric::ncdata` is not sensitive to the environment variable `DIGITS`.

The function uses `option remember`.

## Examples

### Example 1

The following call produces exact data for the quadrature rule with four nodes:

`numeric::ncdata(4)`

## Parameters

 `n` The number of nodes: a positive integer

## Return Values

List `[b,c]` is returned. The lists ```b = [b1, …, bn]``` and ```c = [c1, …, cn]``` are the rational weights and abscissae of the Newton-Cotes quadrature rule, respectively.

## Algorithms

The numerical integrator `numeric::quadrature` calls `numeric::ncdata` to provide the data for Newton-Cotes quadrature.