Latex: Writing "x" Beside a Matrix

  • Context: LaTeX 
  • Thread starter Thread starter EngWiPy
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around formatting a matrix in LaTeX, specifically how to place labels beside the matrix for each row and potentially for each column. Participants explore different methods for achieving this layout in their LaTeX documents.

Discussion Character

  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant presents a matrix and asks how to write labels beside it, specifically for the first row.
  • Another participant suggests a method for labeling just the first row and then questions if the same can be done for every row.
  • A later reply provides a solution for labeling every row, demonstrating the formatting in LaTeX.
  • One participant expresses satisfaction with the solution for rows but raises a new question about how to apply a similar approach for labeling columns.
  • Subsequent posts continue to explore the formatting for column labels, with participants sharing their LaTeX code attempts.

Areas of Agreement / Disagreement

Participants generally agree on the methods for labeling rows but have not reached a consensus on how to effectively label columns, indicating that the discussion remains unresolved regarding that aspect.

Contextual Notes

Participants have not fully explored the limitations or assumptions related to the formatting of column labels, and the discussion lacks a definitive solution for that part of the problem.

EngWiPy
Messages
1,361
Reaction score
61
Hi everyone,

I have the following matrix:

\begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Now I need to write beside the matrix like \mathbf{x}^{(1)}= 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
S_David said:
Hi everyone,

I have the following matrix:

\begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Now I need to write beside the matrix like \mathbf{x}^{(1)}= 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?
<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} = \\ \phantom{x} \\ \phantom{x} \\ \phantom{x} <br /> \end{matrix}<br /> <br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Or every row?


<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}<br /> \end{matrix}<br /> =<br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />
 
D H said:
Just on the first row?
<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} = \\ \phantom{x} \\ \phantom{x} \\ \phantom{x} <br /> \end{matrix}<br /> <br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

Or every row?


<br /> \begin{matrix}<br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)}<br /> \end{matrix}<br /> =<br /> \begin{pmatrix}<br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\<br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\<br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\<br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)}<br /> \end{pmatrix}<br />

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?
 
\begin{matrix} <br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)} <br /> \end{matrix} <br /> = <br /> \begin{matrix}<br /> \begin{matrix}<br /> \mathbf{x_0\ \ }&amp;\mathbf{x_1\ \ }&amp;\ \cdots &amp;\mathbf{x_{N-1}}\\ <br /> \end{matrix}\\<br /> %<br /> \begin{pmatrix} <br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\ <br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\ <br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\ <br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)} <br /> \end{pmatrix}<br /> \end{matrix}<br />
 
robphy said:
\begin{matrix} <br /> \mathbf{x}^{(1)} \\ \mathbf{x}^{(2)} \\ \vdots \\ \mathbf{x}^{(M)} <br /> \end{matrix} <br /> = <br /> \begin{matrix}<br /> \begin{matrix}<br /> \mathbf{x_0\ \ }&amp;\mathbf{x_1\ \ }&amp;\ \cdots &amp;\mathbf{x_{N-1}}\\ <br /> \end{matrix}\\<br /> %<br /> \begin{pmatrix} <br /> x_0^{(1)}&amp;x_1^{(1)}&amp;\cdots &amp;x_{N-1}^{(1)}\\ <br /> x_0^{(2)}&amp;x_1^{(2)}&amp;\cdots &amp;x_{N-1}^{(2)}\\ <br /> \vdots &amp;\vdots &amp;\ddots &amp;\vdots\\ <br /> x_0^{(M)}&amp;x_1^{(M)}&amp;\cdots &amp;x_{N-1}^{(M)} <br /> \end{pmatrix}<br /> \end{matrix}<br />

Thanks
 

Similar threads

Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 52 ·
2
Replies
52
Views
4K
  • · Replies 1 ·
Replies
1
Views
10K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K