problema no início da equação

problema no início da equação

Escrevi o código da equação mas ocorreu um erro ao escrever Jij, alguma ajuda?

equação

\begin{equation}
J_i_j = \left\{ 
  \begin{array}{l l}
    \frac{1}{k}exp\left(-\frac{{||x_i - x_j||}^{2}}{{2a}^{2}}\right) \quad x_i is nearest neighbor of x_j,\\
    0 \quad \text{else}
  \end{array} \right.
\end{equation}

Responder1

Tenho que usar J_{ij}em vez de J_i_jagradecimento ao Werner.

Responder2

 \begin{equation}
 J_{ij} =           %   group subscript with braces
 \begin{cases}      %   use cases macro for piecewise functions
     \frac1K\exp    %   capital K, \exp, you don't have to type braces around single characters
        \left(-\dfrac{\|x_i - x_j\|^2}  {2a^2}\right)   %   \dfrac for display fraction bigger ,\| for double |, less braces   
        & x_i \text{ is nearest neighbour of } x_j,\\   %   use & in cases mode, 
     0  & \text{else}                                   %   \text{} 
 \end{cases}
 \end{equation}

informação relacionada