Learn R Programming

ramify (version 0.3.3)

linspace: Linearly-spaced Elements

Description

Construct a vector of n linearly-spaced elements from a to b.

Usage

linspace(a, b, n = 50)

Arguments

a
The starting value of the sequence.
b
The final value of the sequence.
n
The number of samples to generate. Default is 50.

Value

A vector of linearly-spaced elements.

See Also

logspace, seq.

Examples

Run this code
linspace(0, 1)
linspace(1, 5, 5)
linspace(1+2i, 10+10i, 8)
logspace(0, pi, 10)

Run the code above in your browser using DataLab