Contents Previous Next Subchapters Current Chapters-> algebraic transcendental specialmatrices matrixType systemFunctions conditions xor nextpow2 linspace logspace coldiff diff nozero Parent Chapters-> Omatrix6 elementary linspace Search Tools-> contents reference index search

Evenly Spaced Grid With a Specified Number of Points
 Syntax `linspace(`lower`, `upper`)` `linspace(`lower`, `upper`, `npoint`)` See Also sequence , logspace

Description
Returns a double-precision row vector of int(npoint) equally spaced points starting at lower and ending at upper. The arguments lower, upper, and npoint, are all integer, real, or double-precision scalars. If the argument npoint is not present, the value `100` is used in its place.

Example
If you enter ```      ginit      x = linspace(-pi, +pi)      plot(x, sin(x)) ``` O-Matrix will draw the following plot ``` ```
Reference
Note that the return value of `linspace` is a row vector. So, for example, to make the plot above using gplot you would enter ```      ginit      x = linspace(-pi, +pi)'      gplot(x, sin(x)) ``` (Note the `'` in this example that is not in the example above.)