Generate linearly spaced vectors
y = linspace(a,b)
y = linspace(a,b,n)
The linspace function generates linearly spaced vectors. It is similar to the colon operator ":", but gives direct control over the number of points.
Create a vector of 100 linearly spaced numbers from 1 to 500:
A = linspace(1,500);
Create a vector of 12 linearly spaced numbers from 1 to 36:
A = linspace(1,36,12);