Latex: Writing "x" Beside a Matrix

  • LaTeX
  • Thread starter EngWiPy
  • Start date
  • Tags
    Latex
In summary, the conversation discussed how to write beside a matrix using \mathbf{x}^{(i)} notation, both for individual rows and for all rows. The possibility of doing the same for columns was also mentioned, but it was determined that this approach would not work.
  • #1
EngWiPy
1,368
61
Hi everyone,

I have the following matrix:

[tex]\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
[/tex]

Now I need to write beside the matrix like [tex]\mathbf{x}^{(1)}=[/tex] on the first row but from outside the matrix, and so on. How can I do that?

Thanks in advance
 
Physics news on Phys.org
  • #2
S_David said:
Hi everyone,

I have the following matrix:

[tex]\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
[/tex]

Now I need to write beside the matrix like [tex]\mathbf{x}^{(1)}=[/tex] on the first row but from outside the matrix, and so on. How can I do that?

Thanks in advance

Just on the first row?
[tex]
\begin{matrix}
\mathbf{x}^{(1)} = \\ \phantom{x} \\ \phantom{x} \\ \phantom{x}
\end{matrix}

\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
[/tex]

Or every row?


[tex]
\begin{matrix}
\mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}
\end{matrix}
=
\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
[/tex]
 
  • #3
D H said:
Just on the first row?
[tex]
\begin{matrix}
\mathbf{x}^{(1)} = \\ \phantom{x} \\ \phantom{x} \\ \phantom{x}
\end{matrix}

\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
[/tex]

Or every row?


[tex]
\begin{matrix}
\mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}
\end{matrix}
=
\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
[/tex]

Thanks a lot. That is exactly what I wanted. Now I need to do something similar to the columns, and I guess this approach won't work, will it?
 
  • #4
[tex]\begin{matrix}
\mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}
\end{matrix}
=
\begin{matrix}
\begin{matrix}
\mathbf{x_0\ \ }&\mathbf{x_1\ \ }&\ \cdots &\mathbf{x_{N-1}}\\
\end{matrix}\\
%
\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
\end{matrix}
[/tex]
 
  • #5
robphy said:
[tex]\begin{matrix}
\mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}
\end{matrix}
=
\begin{matrix}
\begin{matrix}
\mathbf{x_0\ \ }&\mathbf{x_1\ \ }&\ \cdots &\mathbf{x_{N-1}}\\
\end{matrix}\\
%
\begin{pmatrix}
x_0^{(1)}&x_1^{(1)}&\cdots &x_{N-1}^{(1)}\\
x_0^{(2)}&x_1^{(2)}&\cdots &x_{N-1}^{(2)}\\
\vdots &\vdots &\ddots &\vdots\\
x_0^{(M)}&x_1^{(M)}&\cdots &x_{N-1}^{(M)}
\end{pmatrix}
\end{matrix}
[/tex]

Thanks
 

1. How do I write "x" beside a matrix in Latex?

To write "x" beside a matrix in Latex, you can use the command \text{x} or \mbox{x} after the matrix code. This will place the letter "x" beside the matrix.

2. Can I customize the position of the "x" beside the matrix?

Yes, you can customize the position of the "x" beside the matrix by using the command \hspace{#cm} or \hspace*{#cm}, where "#" represents the amount of space you want to add in centimeters. This will adjust the horizontal position of the "x" relative to the matrix.

3. How can I add multiple "x"s beside a matrix?

You can add multiple "x"s beside a matrix by using the command \text{x}\text{x}\text{x}, or if you want to adjust the spacing, you can use the command \hspace{#cm} after each "x" to add the desired amount of space.

4. Is it possible to write "x" beside a specific element in the matrix?

Yes, it is possible to write "x" beside a specific element in the matrix by using the command \text{x} or \mbox{x} after the specific element's code. This will place the "x" beside that element only.

5. Can I change the font or size of the "x" beside the matrix?

Yes, you can change the font or size of the "x" beside the matrix by using the command \textbf{x} or \textit{x} for bold or italic, respectively. You can also adjust the font size by using the command \fontsize{#}{#}\selectfont, where the first "#" represents the desired font size and the second "#" represents the line spacing.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Programming and Computer Science
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • Linear and Abstract Algebra
2
Replies
52
Views
2K
Replies
32
Views
1K
Replies
27
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
895
Replies
34
Views
2K
Replies
1
Views
564
Back
Top