Cody

Problem 43753. Laguerre Polynomial

Solution 3844008

Submitted on 25 Nov 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 6; y_correct = [1,0,0,0,0,0,0;1,1,0,0,0,0,0;2,4,1,0,0,0,0;6,18,9,1,0,0,0;24,96,72,16,1,0,0;120,600,600,200,25,1,0;720,4320,5400,2400,450,36,1]; assert(isequal(laguerre(x),y_correct))

L = 1×1 cell array {[1]} L = 1×2 cell array {[1]} {1×2 double}

Index exceeds the number of array elements (2). Error in laguerre (line 8) L{i}=L{i}-[zeros([1 numel(t)-numel(-i*L{i-2})]) -i*L{i-2}] Error in Test1 (line 3) assert(isequal(laguerre(x),y_correct))

2   Fail
x = 1; y_correct = [1,0;1,1]; assert(isequal(laguerre(x),y_correct))

L = 1×1 cell array {[1]} L = 1×2 cell array {[1]} {1×2 double} ans = 1 ans = 1 1

Output argument "y" (and maybe others) not assigned during call to "laguerre". Error in Test2 (line 3) assert(isequal(laguerre(x),y_correct))

3   Fail
x = 3; y_correct = [1,0,0,0;1,1,0,0;2,4,1,0;6,18,9,1]; assert(isequal(laguerre(x),y_correct))

L = 1×1 cell array {[1]} L = 1×2 cell array {[1]} {1×2 double}

Index exceeds the number of array elements (2). Error in laguerre (line 8) L{i}=L{i}-[zeros([1 numel(t)-numel(-i*L{i-2})]) -i*L{i-2}] Error in Test3 (line 3) assert(isequal(laguerre(x),y_correct))

4   Fail
x = 10; y_correct = [1,0,0,0,0,0,0,0,0,0,0;1,1,0,0,0,0,0,0,0,0,0;2,4,1,0,0,0,0,0,0,0,0;6,18,9,1,0,0,0,0,0,0,0;24,96,72,16,1,0,0,0,0,0,0;120,600,600,200,25,1,0,0,0,0,0;720,4320,5400,2400,450,36,1,0,0,0,0;5040,35280,52920,29400,7350,882,49,1,0,0,0;40320,322560,564480,376320,117600,18816,1568,64,1,0,0;362880,3265920,6531840,5080320,1905120,381024,42336,2592,81,1,0;3628800,36288000,81648000,72576000,31752000,7620480,1058400,86400,4050,100,1]; assert(isequal(laguerre(x),y_correct))

L = 1×1 cell array {[1]} L = 1×2 cell array {[1]} {1×2 double}

Index exceeds the number of array elements (2). Error in laguerre (line 8) L{i}=L{i}-[zeros([1 numel(t)-numel(-i*L{i-2})]) -i*L{i-2}] Error in Test4 (line 3) assert(isequal(laguerre(x),y_correct))

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!