Subdivide

Subdivide[n]

generates the list {0,1/n,2/n,,1}.

Subdivide[xmax,n]

generates the list of values obtained by subdividing the interval 0 to xmax into n equal parts.

Subdivide[xmin,xmax,n]

generates the list of values from subdividing the interval xmin to xmax.

Details

  • Subdivide[,n] generates a list of length n+1.

Examples

open allclose all

Basic Examples  (3)

Subdivide the unit interval into 10 equal parts:

Subdivide the interval 0 to 10 into 5 equal parts:

Subdivide the interval to 1 into 8 equal parts using machine precision:

Scope  (2)

Subdivide a symbolic interval from a to b into 6 parts:

Subdivide the interval from E to Pi using exact arithmetic:

Use arbitrary-precision arithmetic starting with 21 digits:

Properties & Relations  (1)

Subdivide[xmin,xmax,n] is equivalent to xmin+(xmax-xmin)Range[0,n]/n:

Introduced in 2015
 (10.1)