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

Published by

Electrical Workbook

We provide tutoring in Electrical Engineering.

Leave a Reply

Your email address will not be published. Required fields are marked *