%% Add Text with Summation Symbol to Graph
% Plot the sine function and plot two polynomials. 

% Copyright 2015 The MathWorks, Inc.


x = linspace(-3,3);
y = sin(x);
plot(x,y)

y0 = x;
hold on
plot(x,y0)

y1 = x - x.^3/6;
plot(x,y1)
hold off

%% 
% Add a text description to the graph that includes a summation symbol using LaTeX
% markup. To use LaTeX, set the |Interpreter| property for the
% text object to |'latex'|.

str = '$$\sin(x) = \sum_{n=0}^{\infty}{\frac{(-1)^n x^{2n+1}}{(2n+1)!}}$$';
text(-2,1,str,'Interpreter','latex')
