6

I'm using LaTeX to show the butterfly visualization of fast Fourier transformation and I'm stuck at drawing the matrix.

I want something like this:

enter image description here

i.e. if I have a vector of length 8, in the next column (after the equal sign), I want two matrices each of length 4 on the same column one below the other, how can I achieve this?

\documentclass{article}
\begin{document}

\left[ \begin{array}{ccc}
1 \\
0 \\
0 \\
0 \\
3 \\
0 \\
0 \\
0 \\ 
\end{array} \right]

\end{document}
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jul 12 '14 at 16:16
6

This requires some manual adjustment, but if you don't have too many of these butterflies, it might be sufficient:

\documentclass{article}
\usepackage{amsmath,xparse}

\ExplSyntaxOn
\RenewDocumentCommand{\vdots}{O{3}}
 {
  \vbox:n
   {
    \skip_set:Nn \baselineskip {4pt}
    \dim_set:Nn \lineskiplimit {0pt}
    \kern 6pt % no equivalent with expl3 at the moment
    \prg_replicate:nn { #1 } { \hbox:n { . } }
   }
 }
\ExplSyntaxOff

\begin{document}
\[
\begin{bmatrix}
0 \\ \vdots[16] \\ n
\end{bmatrix}
=
\begin{matrix}
\begin{bmatrix}
0 \\ \vdots \\ (n+1)/2
\end{bmatrix}
\\[4.7ex]
\begin{bmatrix}
0 \\ \vdots \\ (n+1)/2
\end{bmatrix}
\end{matrix}
\]
\end{document}

The new optional argument to \vdots tells how many dots are to be printed.

enter image description here

3
\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\begin{bmatrix}
a\\b\\c\\d\\e\\f\\g\\h
\end{bmatrix}
&=\!\begin{aligned}
        &\begin{bmatrix}a\\b\\c\\d\end{bmatrix}\\
        &\begin{bmatrix}a\\b\\c\\d\end{bmatrix}
    \end{aligned}\\
&=\ldots
\end{align*}

\end{document}

enter image description here

More practical example

\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\begin{bmatrix}
0\\1\\2\\3\\\vdots\\n-2\\n-1\\n
\end{bmatrix}
&=\!\begin{aligned}
        &\begin{bmatrix}0\\1\\\vdots\\\frac{n+1}{2}\end{bmatrix}\\
        &\begin{bmatrix}0\\1\\\vdots\\\frac{n+1}{2}\end{bmatrix}
    \end{aligned} + \text{ what ever \ldots}\\
&=\!\begin{aligned}
        &\begin{bmatrix}0\\1\\\vdots\\\frac{n+1}{2}\end{bmatrix}\\
        &\begin{bmatrix}0\\1\\\vdots\\\frac{n+1}{2}\end{bmatrix}
    \end{aligned} + \text{ forever \ldots}
\end{align*}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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