0

Below is the code I use:

\begin{center}
\begin{eqnarray}
 \[ E_{n} = \dfrac{1}{N}   \sum_{m}^{}[x(m)w(n-m)]^{2}\]
\end{eqnarray}
\end{center}

However it produces many errors, and it does not give the equation a number. All equations before this were automatically assigned a number. However, this one does not have a number and produces many errors. The errors are:

Bad math environment delimiter. [ Missing \endgroup inserted.

...rac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}] Missing } inserted.

...rac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}] \begin{eqnarray} on input

line 344 ended by \end{equation*}. ...rac{1}{N}

\sum_{m}^{}[x(m)w(n-m)]^{2}]

Missing $ inserted. ...rac{1}{N} \sum_{m}^{}[x(m)w(n-m)]^{2}]

And many more like these. What am I doing wrong here?

3
  • 4
    You're using both \begin{eqnarray} and \[, both of which start math mode. Remove the \[ and \]. But you shouldn't use eqnarray either for reasons stated here. You don't seem to using an array of equations, so just use \begin{equation}...\end{equation} perhaps?
    – frabjous
    Oct 25, 2022 at 18:44
  • 3
    Also the \begin{center} ... \end{center} doesn't do anything here but make the spacing worse. Remove that too.
    – frabjous
    Oct 25, 2022 at 18:47
  • @frabjous thanks a lot it is finally fixed. Oct 25, 2022 at 18:51

1 Answer 1

3

I'm afraid you have really many errors and that looking at an introductory manual is needed. See https://tex.meta.stackexchange.com/a/8477/4427 for some pointers.

  1. Math displays are centered by default, so center does almost nothing; almost in the sense that it does bad, because it marks an allowed page break point, which instead is not allowed before a math display.

  2. eqnarray is deprecated and, in any case, it shouldn't be used for a single equation/formula.

  3. eqnarray and the better environments defined by amsmath already initiate display math mode, so \[ is illegal inside them.

Just remove the wrong parts and use equation for the single equation.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation}
    E_{n} = \frac{1}{N}\sum_{m}[x(m)w(n-m)]^{2}
\end{equation}
\end{document}

enter image description here

1
  • @egreg Thank you very much for your editing.
    – Sebastiano
    Oct 27, 2022 at 19:45

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.