%% Include Superscripts and Subscripts
% Create a histogram, and add a title with the title function. Create a character vector containing TeX markup that displays subscripts and superscripts. Then pass the character vector to the subtitle function.

x = -10:0.1:10;
y1 = x.^2;
y2 = 2*x.^2;
plot(x,y1,x,y2);
title('Exponential Functions')
txt = 'y_1 = x^2 and y_2 = 2x^{2 + k}';
subtitle(txt)

%
% To display an italic font for the variables, add the \it modifier.

txt = '{\ity}_1 = {\itx}^2 and {\ity}_2 = 2{\itx}^{2 + \itk}';
subtitle(txt)

% Copyright 2020 The MathWorks, Inc.