How to use Latex mode in matlab

How to use Latex mode in matlab

Add the following lines to you code. When you see the file it would look wired but when you see the saved figure you will find everything in place. Remember you have to save the figure in "eps" of  "pdf " format only.    

%Program to show how to use Latex mode in matlab
x = linspace(1,100,1000);
plot(x,sin(x))
text(40,0,'$\bar{Q}$','FontSize',20,'Interpreter','latex')
xlabel('$\bar{Q}$','FontSize',20,'Interpreter','latex')
ylabel('$\bar{Q}$','FontSize',20,'Interpreter','latex')
%One can use "\overline" instead of "\bar", because it's looking pretty good.
%text(40,0,'$\overline{Q}$','FontSize',20,'Interpreter','latex') %You can use this also it's pretty good
saveas(gcf,'a','epsc') %You can also use 'pdf' to save the figure in "pdf" format

 

Comments

Popular posts from this blog

How to Embed mp4 movie in beamer latex presentation

How to install ifort compiler in you personal directory on University cluster/workstation

How Install XGRAFIX in Ubuntu-12.04