Skip to content

linspace

Creating a row vector of certain length.

linspace(a, b, n)

  • It returns a vector of length n.
  • a, b and n should be scalars. If n is non-integer, it is rounded.
  • It returns the vector [a, a + d, a + 2*d, ..., a + (n - 1)*d], where d = (b - a) / (n - 1) and n>=2.
  • It returns b if n == 1.
  • It returns an empty matrix if n <= 0.

linspace(a,b)

  • It returns the same result as linspace(a, b, 100).