www.gusucode.com > symbolic 源码程序 matlab案例代码 > symbolic/PlotTexStringOnFigureExample.m

    %% Insert TeX in Figure
% Plot |y = x^2| using |fplot|. Show the plotted expression |y| by using
% |texlabel| to generate a TeX character vector that |text| inserts into the figure.
syms x
y = x^2;
fplot(y)
ylabel = texlabel(y);
text(1, 15, ['y = ' ylabel]);