我写了方程式的代码,但是在书写时出现错误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
对 Werner 的感谢。
答案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}