-1

Possible Duplicate:
How can I create this figure title in MATLAB?

I would like to write down math equations in the m-file in the plot such as

let us say I define

d = 1;

in the MATLAB code. I want to plot with the title such as

title('The Solution of Equations $f(x,t)=0$ when the Parameter is %d')

Please advise.

Community
  • 1
  • 1
user12586
  • 215
  • 5
  • 12
  • You already asked this question. Please explain how this is different other than writing weird function symbols inside the title. http://stackoverflow.com/questions/6666651/matlab-question-quote-value-of-variables-in-the-tile-of-a-plot/6666691#6666691 – aardvarkk Jul 12 '11 at 16:15
  • 1
    Yes the question is how to use tex in the title of a plot of matlab. – user12586 Jul 12 '11 at 16:16
  • @aardvarkk: Although it looks like the previous question at first glance, it is nonetheless different – Jacob Jul 12 '11 at 16:50
  • @Jacob Putting "math equations" in the title of a plot and putting TeX code in the title are two very different things. The question didn't state anything about TeX until I asked. I agree that it's now a valid question. – aardvarkk Jul 12 '11 at 16:53

1 Answers1

0
title(text('Interpreter','latex',...
'String','The solution is: $$\int_0^x\!\int_y dF(u,v)$$',...
'Position',[.5 .5],...
'FontSize',16))
thron of three
  • 521
  • 2
  • 6
  • 19
  • I think there may be versioning problems with the LaTeX intepreter. In my version (7.1!), `text` is automatically interpreted as TeX. So, as far as I can tell, `title('The Solution of Equations f(x,t)=0 when the Parameter is %d')` is already correct? – aardvarkk Jul 12 '11 at 16:56
  • Actually I want to use more complex equations that cannot be handled without tex. – user12586 Jul 12 '11 at 16:58
  • How does it handle quoting the value of variables? – user12586 Jul 12 '11 at 17:02
  • I am using version 7.6, I know that the default interpreter setting is to latex, but I have found if I don't explicitly state it, it will have issues when I try and do things like insert an equation into a string. Also you would need to use the create a math environment to use things like \int. I have not been able to do this without setting the Interpreter to 'latex'. – thron of three Jul 12 '11 at 17:03