方程式開頭的問題

方程式開頭的問題

我寫了方程式的程式碼,但在寫作時出錯Jij,有什麼幫助嗎?

方程式

\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}

答案1

我必須使用維爾納來J_{ij}代替J_i_j感謝。

答案2

 \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}

相關內容