Results 1 to 4 of 4

Math Help - Inserting matrices into equations

  1. #1
    Newbie
    Joined
    Jan 2010
    From
    VA
    Posts
    2

    Inserting matrices into equations

    I've been trying to create vector equations, ie something like

    [matrix1] = [matrix2] [matrix3]

    and am completely stumped. (matrix1 and 3 are 1 x 3 and matrix2 is 3 x 3)

    I've creating the matrices using bmatrix, but no matter what I do they can't play nice. I've tried surrounding them with \begin{equation}...\end{equation}, $$..$$, and \[ ... \] and everytime I can get two matrices on the same line before Latex generates an error. I add each bit piece by piece but by the third matrix Latex complains about a missing $ needing to be inserted, and when I take out the offending bit it still won't compile and the whole equation needs to be deleted.

    It would be great if I can get them with an equation number too.

    What should I do to achieve this?

    Here are my three matrices:

    Code:
    \begin{bmatrix}
    Y \\ I \\ Q
    \end{bmatrix}
    Code:
    \begin{bmatrix}
    0.299 & 0.587 & 0.114 \\
    0.596 & -0.274 &  -0.322 \\
    0.211 & -0.523 & 0.312
    \end{bmatrix}
    Code:
    \begin{bmatrix}
    R \\ G \\ B
    \end{bmatrix}
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Jan 2010
    Posts
    2
    Do you mean like this?

    Code:
    \begin{equation}
    	\begin{bmatrix}
    	Y \\ I \\ Q
    	\end{bmatrix} =
    	\begin{bmatrix}
    	0.299 & 0.587 & 0.114 \\
    	0.596 & -0.274 &  -0.322 \\
    	0.211 & -0.523 & 0.312
    	\end{bmatrix}
    	\begin{bmatrix}
    	R \\ G \\ B
    	\end{bmatrix}
    	\label{eq:1}
    \end{equation}
    The trick seems to be to not include any $ or $$ or \[ or \] at all, they just lead to errors.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jan 2010
    From
    VA
    Posts
    2

    thanks

    Yes, that seems to work. I had something like that code in mind, but for some reason I couldn't get it to work. Must have been missed some character I needed. I always struggle to get the syntax right with Latex's math.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,802
    Thanks
    692
    Hello, bexica!

    I didn't have any trouble . . .


    I've been trying to create a vector equation, like: . \text{[matrix\,1]} \:=\: \text{[matrix\,2]} \times \text{[matrix\,3]}

    \text{[matrix\,1]  and [matrix\:3] are }1\!\times\!3 . . . . no
    . . \text{and [matrix\,2] is }3\!\times\!3
    You have: . [1\times 3] \;=\;[3\times{\color{red}3}]\cdot[{\color{red}1}\times 3] . which cannot be multipled.


    Here are my three matrices:

    Code:
    \begin{bmatrix}
    Y \\ I \\ Q
    \end{bmatrix}
    \text{This is }3\!\times\!1


    Code:
    \begin{bmatrix}
    0.299 & 0.587 & 0.114 \\
    0.596 & -0.274 &  -0.322 \\
    0.211 & -0.523 & 0.312
    \end{bmatrix}
    \text{This is }3\!\times\!3


    Code:
    \begin{bmatrix}
    R \\ G \\ B
    \end{bmatrix}
    \text{This is }3\!\times\!1

    And you want to output:

    \begin{bmatrix}Y \\ I \\ Q \end{bmatrix}\;=\;\begin{bmatrix}0.299 & 0.587 & 0.144 \\ 0.596 & \text{-}0.274 & \text{-}0.322 \\ 0.211 & \text{-}0.523 & 0.312\end{bmatrix} \cdot \begin{bmatrix}R \\ O \\ B \end{bmatrix}

    _{3\times1} . . . . . . . . . _{3\times3}. . . . . . . . _{3\times 1}



    Code:
    \begin{bmatrix}
    Y \\ I \\ Q
    \end{bmatrix}
    
    \;=\; 
    
    \begin{bmatrix}
    0.299 & 0.587 & 0.144 \\
    0.596 & \text{-}0.274 & \text{-}0.322 \\
    0.211 & \text{-}0.523 & 0.312
    \end{bmatrix}
    
    \cdot
    
    \begin{bmatrix}
    R \\ O \\ B
    \end{bmatrix}
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] Problem Inserting EPS Figure into File
    Posted in the LaTeX Help Forum
    Replies: 19
    Last Post: October 1st 2010, 05:57 PM
  2. Problem inserting image in LaTeX file
    Posted in the LaTeX Help Forum
    Replies: 15
    Last Post: July 12th 2010, 06:47 AM
  3. Inserting a caret in LaTeX
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: January 18th 2010, 11:06 AM
  4. Inserting Graphs Into Latex
    Posted in the LaTeX Help Forum
    Replies: 1
    Last Post: September 13th 2009, 09:52 PM
  5. Inserting Limits Into Integral Result
    Posted in the Calculus Forum
    Replies: 3
    Last Post: January 10th 2009, 01:01 PM

Search Tags


/mathhelpforum @mathhelpforum