Skip to main content

Questions tagged [matrices]

{matrices} is about matrices in {equations} and {diagrams}.

Filter by
Sorted by
Tagged with
150 votes
2 answers
1.1m views

Matrix in Latex

I am new to Latex, and I have been trying to get the matrix of following form [x11 x12 x13 . . . . x1n x21 x22 x23 . . . . x2n . . . . xd1 xd2 xd3 . . . . xdn] ...
Lakshmi Narayanan's user avatar
112 votes
5 answers
355k views

How to add a matrix to a LaTeX document

How do we add a matrix to a LaTeX document?
Ashwin Nanjappa's user avatar
95 votes
2 answers
41k views

How to use more than 10 tab stops in bmatrix or other amsmath matrix environments?

I'm using bmatrix environment from the amsmath package, and I'm trying to do something like this: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{...
Martin Tapankov's user avatar
92 votes
3 answers
104k views

How can I increase the line spacing in a matrix?

I'm trying to create a pmatrix whose components are rather complicated fractions (Christoffel symbols), and the line spacing is too small making the whole thing a bit cramped and hard to read. Is ...
Saran Tunyasuvunakool's user avatar
88 votes
7 answers
134k views

How do I left-align entries in a matrix with \begin{matrix}?

I'd like to left align the -1 entry in the following matrix so that the 1s line up. Is there a way to get matrices to ignore signs in that way? \begin{matrix} 1 & 1 \\ 1 & -1 \\ \end{...
Will's user avatar
  • 3,721
86 votes
2 answers
23k views

"Single ampersand used with wrong catcode" error using tikz matrix in beamer

I am having trouble getting a basic example of a matrix of notes to show up in my beamer presentation. I am using the code copied from the pgf manual. Here is a complete working example. The error I ...
user avatar
83 votes
2 answers
347k views

3 dots in matrix

I was wondering if anyone knew how to draw 3 dots in a matrix that go in a diagonal way usually to represent that element flow similarily in the slots. I know there's one that goes in the bottom right ...
user avatar
78 votes
10 answers
118k views

What's the best way make an "augmented" coefficient matrix?

When studying systems of linear equations, it's nice to remind people that the last column of the coefficient matrix holds the constants. This is often done in books by putting a vertical line ...
Dan Ramras's user avatar
77 votes
5 answers
132k views

Label rows of a matrix by characters

How to add label to index the rows and columns of the matrix ? because I want to number the line outside the matrix \[ \begin{array}{lc} \ Mat_{\varPhi to M} & \left(\begin{array}{@...
Chouria Ali's user avatar
  • 1,303
72 votes
13 answers
46k views

Highlight elements in the matrix

I have a matrix and need to highlight some elements in the matrix. I have found how to highlight a single element (I want to put the cell in the square): $$ A = \begin{bmatrix} \fbox{0} & \fbox{0}...
Eugene's user avatar
  • 721
67 votes
5 answers
626k views

How to write an m⨉n matrix in LaTeX?

I tried using the below code but it works only for 2⨉2 matrix. \[ M= \left[ {\begin{array}{cc} 1 & 2 \\ 3 & 4 \\ \end{array} } \right] \] Now the following doesn't work for me: ...
Teja's user avatar
  • 1,279
63 votes
2 answers
48k views

How to create a matrix with 20 columns in latex

The code below works, but when I add 10 more columns, it does not. So, how can I add ten more columns to the matrix below? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{...
Günal's user avatar
  • 3,483
61 votes
9 answers
250k views

typesetting column vector

I would like to define a command which typesets a column vector. For one vector I can have something like: \left( \begin{array}{c} a\\ b\\ \end{array} \right) I would like the command to produce ...
Dror's user avatar
  • 22.8k
58 votes
12 answers
23k views

Is there a way to automatically transpose a matrix written in Latex?

As writing matrices in LaTeX is an extremely time-consuming activity, I was wondering if a software or a site exists that automatically gave the transposed form of a matrix, that is to say, given a ...
Revolucion for Monica's user avatar
56 votes
3 answers
62k views

How to typeset a matrix with MathJax?

I need to typeset a matrix with square brackets as delimiters for math.se (I believe they use MathJaX). How would I do that?
Bob's user avatar
  • 561
52 votes
5 answers
20k views

How do I label different rows or columns of a matrix using braces?

I have a matrix enclosed in brackets [ ] (or (), or {}, or |'s, or ||'s): - a b c d - | e f g h | | i j k l | - m n o p - which I want to label like so: R |---| -- - a b c d -...
Larry Wang's user avatar
  • 3,575
51 votes
5 answers
11k views

Perform matrix operations (addition, product, transpose, etc.) in LaTeX?

I know the calc package can perform infix-notation arithmetic in LaTeX... but I want more! I'd like to perform (not necessarily infix-notation) linear-algebra operations such as scalar ...
jub0bs's user avatar
  • 59.5k
48 votes
3 answers
399k views

Help me input a column vector

I'm trying to input an arrow vector (a column vector, see the picture) in an align environment, but it reports an error. Can someone show me the TeX code of it in an align environment?
dream_big's user avatar
  • 481
47 votes
2 answers
31k views

TikZ matrix as a replacement for tabular

I would like to use TikZ matrices to for some drawings. I am currently using nodes and positioning them manually to simulate a tabular. That helps in positioning arrows and shading. However, if I use ...
ipavlic's user avatar
  • 8,151
45 votes
1 answer
70k views

How do I get normal-sized fractions in my matrices?

I would like to write something like the definition of a gradient operator in cartesian coordinates. \usepackage{amsmath} \begin{equation} \nabla \Phi = \begin{pmatrix} \frac{\partial ...
Niriel's user avatar
  • 942
44 votes
3 answers
53k views

Upper triangular matrix with big zero in lower triangular?

I can represent an upper trapezoidal matrix say as shown below. I would like to replace all those zeros with a single big zero that spans across the low triangle rows and columns, and maybe also add a ...
SkyWalker's user avatar
  • 1,897
43 votes
8 answers
19k views

Using display style fraction in a matrix environment

I'd like use the \dfrac command in a bmatrix environment as follows: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} \dfrac{\partial f}{\partial x} \\ \dfrac{\...
caustic's user avatar
  • 1,087
43 votes
2 answers
154k views

How to draw matrix with dots?

How can I draw a matrix with dots in tex like the one shown below:
Meysam's user avatar
  • 495
41 votes
4 answers
14k views

Multirow/multicolumn cells in TikZ matrices?

Is it possible to make TikZ matrix cells span multiple rows/columns, like they can in LaTeX tables using \multirow or \multicolumn? Specifically, I'd like to typeset something like the following in a ...
amonakov's user avatar
  • 1,022
40 votes
2 answers
163k views

Vertical line in matrix using LaTeXiT [duplicate]

Possible Duplicate: What's the best way make an “augmented” coefficient matrix? I am trying to make a vertical line in a matrix in LaTeXiT. I have read that it should be possible ...
SimonBS's user avatar
  • 503
40 votes
7 answers
37k views

Matrix change row or column background

I have a matrix shown below. I would like to have the whole row green rather than only the cells. How can I do that? \begin{equation}\label{eq:appendrow} \newcommand\x{\times} \newcommand\y{\...
SkyWalker's user avatar
  • 1,897
40 votes
1 answer
111k views

How to represent the trace of a matrix [duplicate]

Possible Duplicate: Define additional math operators to be typeset in roman The trace of a matrix is often written as "Tr [matrix] ", but there does not seem to be a naive LaTeX symbol for this. ...
dmckee --- ex-moderator kitten's user avatar
33 votes
4 answers
171k views

How to draw the calculation of a determinant?

I'm trying to reproduce the following calculation of a determinant in LaTeX: Any ideas? I thought of using the tabular environment but unfortunately I'm not able to align the "=" correctly.
Martin's user avatar
  • 333
32 votes
4 answers
35k views

Where is the \matrix command?

From what I can see, \matrix was a TeX command, but I cannot seem to find documentation on it. It works in MathJax, so I wonder if it can be used in LaTeX. ie this is valid MathJax: $$ \left[ \...
bobobobo's user avatar
  • 4,456
32 votes
3 answers
65k views

How do I make a small pmatrix?

I want a small matrix but the only command I can find is \smallmatrix which leaves the brackets out. Is there a simliar one that includes brackets?
user32462's user avatar
  • 421
32 votes
3 answers
86k views

Vertical spacing between fractions in matrix environment [duplicate]

Possible Duplicate: How can I increase the line spacing in a matrix? Using display style fraction in a matrix environment How to add extra spaces between rows in tabular environment? When a ...
Quinn Culver's user avatar
31 votes
5 answers
74k views

Diagonal dots spanning multiple lines/columns of a matrix

I'm filling in large sparse matrices, for example \begin{bmatrix} 0 & -2 & 1 & & -1 & 2 \\ 2 & \ddots & \ddots & \ddots & & -1 \\ ...
ZulfiqarIII's user avatar
30 votes
2 answers
3k views

Levi-Civita symbol: 3D matrix

During the current review of the tensors I have arrived at a page of Wikipedia where you can see the symbol of Levi-Civita in a beautiful three-dimensional matrix. I hope that nobody will be angry ...
Sebastiano's user avatar
  • 56.8k
30 votes
3 answers
85k views

vertical and horizontal line in a matrix

I want to create a bmatrix on the right \documentclass[10pt,a4paper]{article} \usepackage[english]{babel} \usepackage{amsmath} \begin{document} \begin{equation} \begin{bmatrix}[c|c] _B[T]_B &...
axiom's user avatar
  • 401
29 votes
8 answers
71k views

How to construct a confusion matrix in LaTeX?

A confusion matrix looks like: Is there an easy way to do the same using LaTeX? Otherwise I could just create a diagram with any software.
kkudi's user avatar
  • 545
28 votes
4 answers
4k views

Problem with defining shortcuts for TikZ matrices

For answering a question yesterday I wanted to define a shortcut for creating a matrix inside a tikzpicture. As a minimal example, consider \newcommand\mymatrix[1]{ \begin{tikzpicture} \...
Caramdir's user avatar
  • 90.2k
28 votes
3 answers
24k views

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

(From the notation used in course notes for Stanford CS229 available online.) I'm trying to typeset the following matrices made up of row or column vectors: Any ideas?
zellyn's user avatar
  • 383
27 votes
6 answers
188k views

How to have matrices side by side in latex?

I'm new to latex and all of my matrices seem to be created on new lines, I can't seem to put them side by side. Here is what I am doing to make a matrix (with the 2d identity matrix as an example): \...
user avatar
27 votes
2 answers
25k views

Matrix in a matrix

I would like to draw a matrix with top left, top right, bottom left and bottom right blocks. The top left should be a 3x3 matrix with numerical entries, the top right is 0, the bottom left is 0 and ...
Karlr's user avatar
  • 273
26 votes
3 answers
17k views

Aligning the minus sign in a matrix

I would like to be able to align the minus sign in a matrix so that the minus is to the left of the numerical column. I have written my matrix as the following: \begin{eqnarray} \left( \begin{...
Irreversible's user avatar
26 votes
4 answers
10k views

Draw a line through one column of a matrix

I'd like to "cancel" (draw a line through) a column of a matrix (using \begin{pmatrix}..\end{pmatrix}). How can I do this?
jtbandes's user avatar
  • 4,272
24 votes
6 answers
21k views

bordermatrix with blocks

I need to write a complicated matrix, that has a structure as in the attached picture.
user avatar
23 votes
3 answers
23k views

Underbrace in a matrix

I want to display the structure of a matrix as shown in the image below: Can this be done using pmatrix and \underbrace? My attempt at combining pmatrix and \underbrace results in a compile error. \...
I Like to Code's user avatar
23 votes
7 answers
17k views

Formatting arrows between rows of corresponding matrices

Some material I'm creating requires output that looks like this: (note the position of the arrows). I'm using the following code (with the AMS macros) to generate this, and I'm looking for ...
rogerl's user avatar
  • 3,683
22 votes
4 answers
3k views

Matrix with labels nested in braces

What's the best way to produce a matrix with labels that are nested in braces, like this:
Noam Ross's user avatar
  • 323
22 votes
2 answers
46k views

How to write matrices with dimensions in latex?

I am just starting to use latex, and with all the internet help i figured out how to do many things myself, but now i am stuck. How can I write what you all can see in the picture? Thanks for the ...
Newee's user avatar
  • 321
22 votes
3 answers
5k views

How can I visualize Matrix operations?

I would like to visualize some matrix operations like that: How can I do that (preferably something that also works for mathjax)?
Martin Thoma's user avatar
21 votes
5 answers
3k views

Huge matrix in my document. Possible ways to make it look better?

The following is the source for a matrix I'm using in my document: \documentclass{scrartcl} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{amsmath} \...
InvisiblePanda's user avatar
21 votes
3 answers
38k views

Adjusting separation between matrix entries

I have a very large matrix which overflows in the margin. I would like the matrix to fit inside the margins, but I would like to do this without rescaling it, and also without affecting other array-...
Smurf's user avatar
  • 345
21 votes
2 answers
11k views

Creating a matrix with column or row vectors as arguments

At times it's convenient to write a matrix in terms of it's row or column component vectors instead of explicitly giving each particular scalar entry. I'm basically talking about this: I did some ...
Dirkboss's user avatar
  • 311

1
2 3 4 5
41