I want to simplify codes for writing vectors. For example, if I write
\vector{1,2,3}
it would be equivalent to
\begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}
Similarly
\vector{1,2,3,4}
would be
\begin{bmatrix} 1 \\ 2 \\ 3 \\ 4 \end{bmatrix}
How can I create a macro for this type of work?