MATLAB linspace

linspace( ) command or function creates a row vector with elements that are linearly (equally) spaced, after reading this MATLAB linspace topic, you will know the theory and examples.


Syntax:

linspace(xf,xl,n)

  • xf is the first element of the row vector.
  • xl is the last element of the row vector.
  • n is the number of elements in the row vector.

Example: To create the row vector having equally spaced elements.

linspace(0,8,6)

Output:

ans =

0 1.6000 3.2000 4.8000 6.4000 8.0000

Leave a Comment

error: Content is protected !!