www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/AddTextWithSymbolsAndSuperscriptsExample.m

    %% Include Superscripts and Annotations in Graph Text
% Create  a line plot and add a title and axis labels to the graph. Display
% a superscript in the title using the |^| character. The |^| character
% modifies the character immediately following it. Include multiple
% characters in the superscript by enclosing them in curly braces |{}|.
% Include the Greek letters $\alpha$ and $\mu$ in the text using the TeX
% markups |\alpha| and |\mu|, respectively.
% 

t = 1:900;
y = 0.25*exp(-0.005*t);

figure
plot(t,y)
title('Ae^{\alphat} for A = 0.25 and \alpha = -0.0005')
xlabel('Time \musec')
ylabel('Amplitude')
%% 
% Add text at the data point where |t = 300|. Use the TeX markup |\bullet|
% to add a marker to the specified point and use |\leftarrow| to include an
% arrow pointing to the left. By default, the specified data point is to
% the left of the text. 

txt = '\bullet \leftarrow 0.25t e^{-0.005t} at t = 300';
text(t(300),y(300),txt)