Add LaTeX expression

philippe roux rouxph.22 at gmail.com
Sun Jun 12 13:11:16 CEST 2011


Le 12/06/2011 08:18, Orbeman a écrit :
>
> It is possible to add a LaTeX expression in graph like y=x^n where n is a
> scalar computed by program ?

yes, use "string" to convert a scalar variable to a string, see example 
below :

n=2; x=[-2:0.02:2]';y=x.^n;plot2d(x,y,5);
xtitle('$ y=x^{'+string(n)+'}$'), xstring(-0.5,1,'$x^{'+string(n)+'}=0$')

remark that the string send to "xtitle" or "xstring" must beging by "$" 
and end with "$"  (or "$$") otherwise latex code is not interpreted ...

Philippe.




More information about the users mailing list