A vector in MATLAB is a matrix with one row or one column. It's critical to understand the difference between row and column vectors. Many programming problems occur when a row vector is used instead of a column vector, and vice versa.
Square brackets  are used to form column vectors, with semicolons or newlines used to divide elements. The transpose operator can be used to convert a row vector to a column vector (and vice versa).
The length of the greatest array dimension in X is returned by L = length(X). The length of a vector is just the number of elements. The length of an array with more dimensions is max(size(X)).
To make an array containing several elements in a single row, use a comma ',' or a space to separate the elements. A row vector is the name for this sort of array. To make an array with several elements in a single column, use semicolons ';' to divide the elements. A column vector is the name for this sort of array.
x = input(prompt) shows the prompt text and waits for the user to enter a value and press the Return key. The user can use variables in the workspace and enter equations like pi/4 or rand(3). Input returns an empty matrix if the user pushes the Return key without entering anything.