I am wondering how to implement text in a legend with both a superscript and a subscript, and with an horizontal bar, something like this:Image
$\endgroup$ 11 Answer
$\begingroup$Whenever you want to use some $\LaTeX$-style text in MATLAB, you have to specifiy the corresponding Interpreter option to use LaTeX. For a legend with your provided example this works with
legend("$\bar{H}^{front}_{debris}$",'Interpreter','latex') $\endgroup$