linspace
Generate linearly spaced vector
Description
y = linspace(
returns a row vector of
evenly spaced points between x1,x2
)x1
and x2
. By default,
linspace
generates 100 points.
y = linspace(
generates x1,x2
,n
)n
points. The spacing between the points is
(x2-x1)/(n-1)
.
linspace
is similar to the colon operator,
“:
”, but gives direct control over the number of points
and always includes the endpoints. “lin
” in the name
“linspace
” refers to generating linearly spaced values as
opposed to the sibling function logspace
, which generates logarithmically
spaced values.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced before R2006a