www.gusucode.com > symbolic 源码程序 matlab案例代码 > symbolic/PlotLegendrePolynomialsExample.m

    %% Plot Legendre Polynomials
% Plot Legendre polynomials of orders |1| through |4|.

syms x y
fplot(legendreP(1:4, x))
axis([-1.5 1.5 -1 1])
grid on

ylabel('P_n(x)')
title('Legendre polynomials of degrees 1 through 4')
legend('1','2','3','4','Location','best')