Page 143 - Basics of MATLAB and Beyond
P. 143
x = linspace(0,2);
y = 1./(1-x);
plt(x,y)
text(1,75,...
’ y \rightarrow \pm\infty’)
The T X syntax of ‘_’ and ‘^’ to produce subscripts and superscripts is
E
also supported:
t1 = linspace(-5,5);
y = cos(t1.^2);
plt(t1,y)
title(’cos(t_1^2)’)
If the sub- or superscript is more than one character, use curly brackets
to define the scope:
title(’cos(t_{i,j}^{2m + 1})’)
◦
For degree symbols (e.g. 30 ), use \circ.(In T X you would use \circ
E
in a superscript, $30^\circ$, but doing that in matlab makes the
degree symbol too high and too small.)
title(’Plot for \alpha = 30\circ’)
33.2 Symbols in Tick Labels
To put T X symbols in tick mark labels you cannot use the commands of
E
the xlabel family; they currently do not interpret the T X syntax. How-
E
ever, you can replace the default ticklabels with Text objects that contain
c c 2000 by CRC Press LLC