Cody

Problem 1473. Legendre polynomials

Given an integer n ≥ 0, generate the n-th Legendre polynomial.

Examples:

 legendrePoly(0)
 ans =
     1
 legendrePoly(1)
 ans =
     1     0
 legendrePoly(2)
 ans =
     1.5   0   -0.5

Neither string operations nor interpolations are allowed!

Solution Stats

64.0% Correct | 36.0% Incorrect
Last solution submitted on Mar 17, 2016

Problem Comments

Tags

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more