0

I want to write an equation like the following:

enter image description here

What's the problem with the following code?

\begin{array}{lll}
        U_2(\phi)=\begin{bmatrix}
            \cos\phi & -\sin\phi \\ \sin\phi \cos\phi
        \end{bmatrix} 
        & \Rightarrow 
        & U_{3T}(2\phi)=\begin{bmatrix}
        1 & 0 & 0 \\ 0 & \cos 2\phi & \sin 2\phi \\ 0 & -\sin\2\phi & \cos 2\phi
        \end{bmatrix}
        \\
        U_2(\tau)=\begin{bmatrix}
    \cos\tau & j\sin\tau \\ j\sin\tau & \cos\tau
    \end{bmatrix} 
    & \Rightarrow 
    & U_{3T}(2\tau)=\begin{bmatrix}
    \cos 2\tau & 0 & j\sin 2\tau \\ 0 & 1 & 0 \\ j\sin 2\tau & 0 & \cos 2\tau
    \end{bmatrix}
    \\
    U_2(\alpha)=\begin{bmatrix}
    e^{+j\alpha} & 0 \\ 0 & e^{-j\alpha}
    \end{bmatrix} 
    & \Rightarrow 
    & U_{3T}(2\alpha)=\begin{bmatrix}
    \cos 2\alpha & j\sin 2\alpha & 0 \\ j\sin 2\alpha & \cos 2\alpha & 0 \\ 0 & 0 & 1
    \end{bmatrix}
    \end{array}

I'm getting the following error at line 7:

Error:

Undefined control sequence. ... & \cos 2\phi & \sin 2\phi \ 0 & -\sin\2

at line:

1 & 0 & 0 \ 0 & \cos 2\phi & \sin 2\phi \ 0 & -\sin\2\phi & \cos 2\phi

  • 2
    You have escaped a 2: instead of \sin 2 you wrote \sin\2 (see the end of the line Undefined control sequence ...) – Astrinus Dec 16 '16 at 12:39
  • @Astrinus you're right. The problem is solved now. I don't know whether to keep the question or delete it cuz I don't know if such questions that are related to typos and the OP's recklessness are allowed on site or not? – Sepideh Abadpour Dec 16 '16 at 12:44
  • 5
    I'm voting to close this question as off-topic because the problem was caused by a typing error, identified in the comments. – barbara beeton Dec 16 '16 at 13:23
2

It seems \2 could be the problem. I can reproduce your error. If I take out the \2, it runs.

maybe you meant \,2 (an extra space) before the 2? or _2

If that doesn't solve your problem, please provide a MWE. The code doesn't compile for me because I don't know which packages you use, so I only compiled the contents of that one line.

Edit: I know this should be a comment, but I can't write those yet. It's really hard to build up the first bit of reputation.

  • The problem is solved as I've said in the comments. The right code is code – Sepideh Abadpour Dec 16 '16 at 12:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.