.. highlightlang:: us .. _linspace: linspace ======== .. index:: linspace .. us.tag linspace NOTREADYENGLISH The :ref:`linspace` function creates a vector from *s1* to *s2* with *n* elements. .. function:: rv = linspace(s1, s2) rv = linspace(s1, s2, n) .. us.return **Return Value** *rv* is the a linearly spaced vector. .. us.params **Parameters** .. uparam:: s1 *s1* is the start value .. uparam:: s2 *s2* is the end value .. uparam:: n *n* is the number of elements (Default is 100). .. us.comment **Comment** :ref:`linspace` generates linearly spaced vectors. It is similar to the colon operator ``":"``, but gives direct control over the number of points. .. us.example **Example** :: x = linspace(0, 2*PI) y = sin(x) plot(x, y) .. seealso:: :ref:`overview-mathematic`, :ref:`logspace` :sub:`id-791325`