function r=my_sum (n);

x_values=0:.1:20;
%taylor_sin=zeros(length(x_values),1);

for i=1:length(x_values)
for j=1:n
x(j)=[(-1)^(j-1)*(x_values(i))^(2*j-1)]/factorial(2*j-1);
end;
taylor_sin(i)=sum(x);
end;
length(taylor_sin)
length(sin(x_values))
A=sin(x_values)-taylor_sin;

subplot(2,1,1);
plot(x_values,taylor_sin)
hold on;
plot(x_values,sin(x_values))
subplot(2,1,2);
plot(x_values,A)