I'm trying to plot two step responses alongside with experimental results. Plot looks okay, but for some reason Matlab inserts a backslash before underscore for the step legend. How do I fix the legend?
\omega_{experimental} and \theta_{experimental} work
\omega_{modelo} and \theta_{modelo} don't
f2 = figure('DefaultAxesFontSize', 14);plot(t_exp,omega_exp,'red');hold onplot(t_exp,theta_exp,'blue');hold onstep(12*Go);hold onstep(12*Gt);title('Comparação do modelo obtido com a resposta experimental')xlabel('Tempo (segundos)')ylabel(' ')legend({'$\omega_{experimental} (rad/s)$','$\theta_{experimental} (rad)$',... '$\omega_{modelo} (rad/s)$','$\theta_{modelo} (rad)$'},... 'Interpreter','latex','Location','southeast','FontSize',16);set(gca,'XLim',[0 1])
This is what I'm getting:
This is the backslash that Matlab inserts for some reason (seen by double-clicking the plot legend):
Full code is attached. Thanks in advance!
Best Answer