Learn R Programming

pracma (version 1.8.8)

linspace: Linearly Spaced Sequences

Description

Generate linearly spaced sequences.

Usage

linspace(x1, x2, n = 100)

Arguments

x1
numeric scalar specifying starting point
x2
numeric scalar specifying ending point
n
numeric scalar specifying number of points to be generated

Value

  • vector containing n points between x1 and x2 inclusive.

Details

These functions will generate n linearly spaced points between x1 and x2.

If $n < 2$, the result will be the ending point x2.

See Also

logspace, seq

Examples

Run this code
linspace(1, 10, 9)

Run the code above in your browser using DataLab