I came across some MATLAB syntax with a colon that I don\'t fully understand.
The expression: 0:pi/4:pi
results in the answer
My two pennies to KennyTM's answer.
Actually scalar and vector variables in MATLAB have 2 dimensions. Scalar has 1 row and 1 column, and vector has either 1 row or column. Just try size(X).
Colon (:) operator for indexing simply means all. Syntax X(:,1:3) means get all rows and columns from 1 to 3. Since your variable X has only 1 row, you will get first 3 values in this row.