## plot_P
x1=-1:0.01:1;
n=length(x1);
y2=zeros(n,1);
for i=1:n
  y2(i)=P(1,x1(i));
endfor
plot(x1,y2);
hold on
for m=2:5
for i=1:n
  y2(i)=P(m,x1(i));
endfor
plot(x1,y2);
title("Legendre polynomials m=1..5");
xlabel("x");
ylabel("Legendre polynomial P(m,x)");
endfor
hold off

 
