Linspace function:
Likewise, the linspace function generates a linearly spaced vector; linspace(x,y,n) generates a vector with n values in the inclusive range from x to y. For illustration, the following generates a vector with 5 values linearly spaced between 3 and 15, involving the 3 and 15:
>> ls = linspace(3,15,5)
ls =
3 6 9 12 15
The Vector variables can also be generated using existing variables. For illustration, a new vector is generated here consisting first of all the values from nv followed by all values from ls:
>> newvec = [nv ls]
newvec =
1 3 5 7 9 3 6 9 12 15
Place two vectors altogether like this to generate a new one is termed as concatenating the vectors.