0

Please help me solve this problem The code below produces the error

Missing delimiter (. inserted).

\begin{equation}
S_{i j} =
\begin{cases}e ^{ - \max \left(\left| p_{i} - p_{j}\right|,\left|q_{i} - q_{j}\right|\right) / \lambda_{s} -\left \|x_{i} - x_{j}\right\| ^ {2} / \lambda_{g} \sigma_{i} ^ {2}}, & i \neq j \\ 0, & i=j,
\end {cases}
\end{equation}
4
  • 1
    Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. Commented Sep 6, 2021 at 14:35
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Sep 6, 2021 at 14:35
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Commented Sep 6, 2021 at 14:42
  • 2
    This exact example added to a document that loaded amsmath compiles just fine for me.
    – daleif
    Commented Sep 6, 2021 at 14:49

1 Answer 1

1

Your code compiles without error for me. That said, I'd look to making the output more visually appealing by using \exp(...) notation instead of e^{...} notation.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{mathtools}  % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter\abs\lvert\rvert
\DeclarePairedDelimiter\norm\lVert\rVert
\usepackage{xcolor}

\begin{document}
\noindent\textcolor{red}{Before}
\begin{equation}
S_{i j} =
\begin{cases}e ^{ - \max \left(\left| p_{i} - p_{j}\right|,\left|q_{i} - q_{j}\right|\right) / \lambda_{s} -\left \|x_{i} - x_{j}\right\| ^ {2} / \lambda_{g} \sigma_{i} ^ {2}}, & i \neq j \\ 0, & i=j,
\end {cases}
\end{equation}

\bigskip\noindent\textcolor{red}{After}
\begin{equation}
S_{ij} =
\begin{cases}
\exp\bigl\{ -\max( \abs{p_i - p_j},\abs{q_i - q_j}) / \lambda_{s} 
            -\norm{x_i - x_j}^2 / \lambda_{g}\sigma_i^2 \bigr\} 
    & i\neq j\,, \\ 
0   & i=j\,.
\end {cases}
\end{equation}
\end{document}
1
  • 2
    Thank you very much
    – Imili MH
    Commented Sep 6, 2021 at 16:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .