linspaceΒΆ
The linspace function creates a vector from s1 to s2 with n elements.
-
rv = linspace(s1, s2)
-
rv = linspace(s1, s2, n)
Return Value
rv is the a linearly spaced vector.
Parameters
-
s1
s1 is the start value
-
s2
s2 is the end value
-
n
n is the number of elements (Default is 100).
Comment
linspace generates linearly spaced vectors. It is similar to the colon
operator ":"
, but gives direct control over the number of points.
Example
x = linspace(0, 2*PI)
y = sin(x)
plot(x, y)
See also
id-791325