Skip to contents

Creates a vector of n elements equally spaced apart.

Usage

linspace(a, b, n = 100)

Arguments

a

initial number

b

final number

n

number of elements (integer >= 2)

Value

vector of numbers from a to b with n linearly spaced apart

Examples

linspace(0,100, 20)
#>  [1]   0.000000   5.263158  10.526316  15.789474  21.052632  26.315789
#>  [7]  31.578947  36.842105  42.105263  47.368421  52.631579  57.894737
#> [13]  63.157895  68.421053  73.684211  78.947368  84.210526  89.473684
#> [19]  94.736842 100.000000