Writing a Matrix: Tips & Suggestions

In summary: The nicest way is to use LaTeX. Here's an example with the tags showing (with extra spaces in the tags so that they will show).[ tex] \begin{bmatrix} 2&6&0\\0&2&0\\0&0&3\end{bmatrix}[ /tex]Removing the extra spaces in the tex tags and the begin and end statements produces this 3 x 3 matrix:\begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix}Thank you gentlemen.\begin{bmatrix} 2&0&6
  • #1
trap101
342
0
My apologies if this is in the wring place, but is there any way that I can write a matrix out on this forum? Maybe set up a table in excel or word and copy over? Any suggestions?
 
Physics news on Phys.org
  • #2
trap101 said:
My apologies if this is in the wring place, but is there any way that I can write a matrix out on this forum? Maybe set up a table in excel or word and copy over? Any suggestions?

You can use plain text, like this: A = [[a,b],[c,d]] (and explain that this means [row1,row2]), or you can use tex, like this:
[tex] A = \left[ \begin{array}{cc} a & b \\ c & d \end{array} \right]. [/tex]

The instructions used for the latter are:
"[t e x] A = \left[ \b e g i n{a r r a y}{cc} a & b \\ c & d \e n d{a r r a y} \right]. [/ t e x]"
When you type it out, remove the quotation marks and remove the spaces within words, so type 'tex' instead of 't e x', type 'begin' instead of 'b e g i n', type 'array' instead of 'a r r a y', etc. You don't need to remove spaces inside formulas, so it is OK to type a & b \\ c & d, etc. If you prefer rounded brackets, change '\left[' to '\left(', and similarly for '\right'. That would give
[tex] A = \left( \begin{array}{cc} a & b \\ c & d \end{array} \right). [/tex]

RGV
 
  • #3
trap101 said:
My apologies if this is in the wring place, but is there any way that I can write a matrix out on this forum? Maybe set up a table in excel or word and copy over? Any suggestions?

The nicest way is to use LaTeX. Here's an example with the tags showing (with extra spaces in the tags so that they will show).

[ tex] \ begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \ end{bmatrix}[ /tex]

Removing the extra spaces in the tex tags and the begin and end statements produces this 3 x 3 matrix:
[tex] \begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix}[/tex]
 
  • #4
Thank you gentlemen.
 
  • #5
[tex]\begin{bmatrix}2&0&6\\6&8&8\\0&6&8\end{bmatrix}[/tex]
 
  • #6
\ begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \ end{bmatrix}
 
  • #7
begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \ end{bmatrix}
 
  • #8
begin{bmatrix}2&0&6\\6&8&8\\0&6&8\end{bmatrix}
 
  • #9
[tex] A = \left[ \begin{array}{cc} 3&4\\ 2&2\end{array}\right]. [/tex]
 
  • #10
[ tex]\begin{bmatrix} 2&6&0\\0&2&0\\0&0&3\end{bmatrix}[ /tex]
 
  • #11
\begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix}
 
  • #12
Looks good.

As you can see, the LaTeX that Ray Vickson and I wrote, both produce matrices. For simple matrices, the \begin{bmatrix} ... \end{bmatrix} style is easier, IMO.

The b in bmatrix stands for bracket - []. There's also a pmatrix style that uses parentheses () to surround the matrix. There's another form that I don't recall at the moment - I think it surrounds the matrix with vertical lines, like you would use for a determinant.

There are lots of summaries and tutorials on the Web, so a search for "latex tutorial" will get you a bunch of links. There's also a sticky post in Forum Feedback and Announcements here at PF (https://www.physicsforums.com/showthread.php?t=546968) that gives an overview of the things you can do.

If you need to do more complicated matrices, then the style that Ray showed is more versatile, allowing you to write augmented matrices and other stuff.
 
  • #13
Appreciated. Definitely something I'll probably have to use in the future when it comes to programming too, so i might as well get a fix on it.

Cheers
 
  • #14
trap101 said:
Appreciated. Definitely something I'll probably have to use in the future when it comes to programming too, so i might as well get a fix on it.

Cheers

It might not have been obvious to you, but between the column separators " & " you can put any formula; and, if you use the "array" form you can justify the columns (separately); for example, "{ccc}" means "center" the items in each column; "lcr" means left-justify column 1, center column 2 and right-justify column 3; you might want to do this for something like:
[tex]
A = \left[ \begin{array}{lcr}
abba & a_{11}x_1^2 + \ln(x_2) & 12.0 \\
aaabbbaa & \sqrt{x_1^2 + x_2^2} & 125.4 \end{array} \right]. [/tex]

RGV
 

FAQ: Writing a Matrix: Tips & Suggestions

What is a matrix in writing?

A matrix in writing is a visual tool used to organize and develop ideas, characters, and plot points in a story. It is a chart or grid with intersecting rows and columns that help writers map out the different elements of their story.

How do I create a matrix for my writing?

To create a matrix for your writing, start by identifying the key elements of your story, such as characters, setting, and plot points. Then, create a chart or grid with intersecting rows and columns, labeling each with the different elements. Finally, fill in the matrix with details and connections between each element.

What are the benefits of using a matrix in writing?

A matrix can help writers to organize their ideas and develop their story more effectively. It allows for a visual representation of the relationships between different elements, making it easier to identify plot holes or inconsistencies. It can also serve as a reference guide to keep the story on track.

Can a matrix be used for any type of writing?

Yes, a matrix can be used for any type of writing, whether it's fiction, non-fiction, or even academic writing. It can be especially helpful for more complex narratives or stories with multiple characters and plot points.

Are there any tips for using a matrix in writing?

One tip for using a matrix in writing is to keep it simple and organized. Avoid overcrowding the matrix with too much information and use different colors or symbols to distinguish between elements. It's also important to regularly review and update the matrix as the story progresses to ensure consistency and coherence.

Back
Top