% % code12Ma.m -- 22 nov 02 -- djm % % clear workspace & graphics clear; close all % axes dx = 0.01; x = -1:dx:1; % plot line graphs for j=0-4 (first row of P matrix, "helpp legendre") figure(1); hold on for j=0:4 P = legendre(j,x); plot(x,P(1,:)) end axis([-1 1 -1.1 1.1]); % label plot title(['\bf Legendre Polynomials: n=0...4']) xlabel('\bf x-axis') ylabel('\bf P_n(x)-axis') text(-0.5,0.7,'\bf P_n(x) is n^{th}-degree & has n zeros')