# How to Typeset a Vector

How to typeset vector like this in latex

I came across an article

How do I typeset vertical and horizontal lines inside a matrix?

which mentions below code

$U = \left[ \begin{array}{cccc} \vertbar & \vertbar & & \vertbar \\ u^{(1)} & u^{(2)} & \ldots & u^{(n)} \\ \vertbar & \vertbar & & \vertbar \end{array} \right]$


and generates equation like this

I have trouble putting right part in the equation, How can I do it.

• Member for more than 2 years without a MWE? What have you tried so far? – CarLaTeX Aug 22 '17 at 4:21
• You could add a simple matrix with the u's, we'll add the rules. Helping is fun but re-typing all is boring! – CarLaTeX Aug 22 '17 at 4:34
• Of course, but why should I do it? Please, help us to help you. As is, your question shows no effort by you, it's a just-do-it-for-me one. – CarLaTeX Aug 22 '17 at 5:48
• I do not understand where your problem is. If you add \in \mathbb R^{n \times n} after \right], the result should be the desired one. – epR8GaYuh Aug 22 '17 at 7:23
• Much better: as you can see, you've already got an answer this way. Next time remember to add a complete MWE, your code snippet isn't compilable (even if the complete one can be copied from the link). – CarLaTeX Aug 22 '17 at 7:26

I would prefer to use bmatrix from amsmath. The R can be done using \mathbb from amssymb (or amsfonts).
\documentclass{article}
$U = \begin{bmatrix} \vert & \vert & & \vert\\ u^{(1)} & u^{(2)} & \ldots & u^{(n)} \\ \vert & \vert & & \vert \end{bmatrix} \in\mathbb{R}^{n\times n}$