I am trying to get my legend written in latex code, however I don't quite get most of the solutions I found when searching. My code is quite long, so I made a simplified version:
%
A= cos(tau)l1 = sin(tau)l2 = sin(tau + pi/8)plot(tau, A, 'DisplayName', 'A(\tau)'), hold onplot(tau, l1, 'HandleVisibility','off'), hold onplot(tau, l2, 'DisplayName', 'l with $\eta_0 = \pi - \asin(\sqrt{K})$')legend show
I have seen several solutions with legend(… 'interpreter', 'latex'), but I don't see how to incorporate that into my code. I have also seen some set(f,'defaulttextinterpreter','latex') but again I don't quite know how to use it and when I tried I only got an error.
Best Answer