linspace: Linearly Spaced Sequences

Description Usage Arguments Details Value See Also Examples

View source: R/linspace.R

Description

Generate linearly spaced sequences.

Usage

1
  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

Details

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

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

Value

vector containing n points between x1 and x2 inclusive.

See Also

logspace, seq

Examples

1
linspace(1, 10, 9)

Example output

[1]  1.000  2.125  3.250  4.375  5.500  6.625  7.750  8.875 10.000

pracma documentation built on Dec. 11, 2021, 9:57 a.m.