Cody

Problem 1474. Chebyshev polynomials of the 1st Kind

Solution 1961695

Submitted on 6 Oct 2019
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
user_solution = fileread('chebyshev1stKindPoly.m'); assert(isempty(strfind(user_solution,'regexp'))); assert(isempty(strfind(user_solution,'2str'))); assert(isempty(strfind(user_solution,'str2'))); assert(isempty(strfind(user_solution,'interp'))); assert(isempty(strfind(user_solution,'printf'))); assert(isempty(strfind(user_solution,'assert')));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

2   Fail
n = 0; P_correct = [1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

3   Fail
n = 1; P_correct = [1 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

4   Fail
n = 2; P_correct = [2 0 -1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

5   Fail
n = 3; P_correct = [4 0 -3 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

6   Fail
n = 4; P_correct = [8 0 -8 0 1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

7   Fail
n = 5; P_correct = [16 0 -20 0 5 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

8   Fail
n = 6; P_correct = [32 0 -48 0 18 0 -1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

9   Fail
n = 7; P_correct = [64 0 -112 0 56 0 -7 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

10   Fail
n = 8; P_correct = [128 0 -256 0 160 0 -32 0 1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

11   Fail
n = 9; P_correct = [256 0 -576 0 432 0 -120 0 9 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

12   Fail
n = 10; P_correct = [512 0 -1280 0 1120 0 -400 0 50 0 -1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

13   Fail
n = 11; P_correct = [1024 0 -2816 0 2816 0 -1232 0 220 0 -11 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

14   Fail
n = 12; P_correct = [2048 0 -6144 0 6912 0 -3584 0 840 0 -72 0 1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

15   Fail
n = 13; P_correct = [4096 0 -13312 0 16640 0 -9984 0 2912 0 -364 0 13 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

16   Fail
n = 14; P_correct = [8192 0 -28672 0 39424 0 -26880 0 9408 0 -1568 0 98 0 -1]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.

17   Fail
n = 15; P_correct = [16384 0 -61440 0 92160 0 -70400 0 28800 0 -6048 0 560 0 -15 0]; assert(isequal(chebyshev1stKindPoly(n),P_correct));

Error in solution: Line: 36 Column: 1 The function "ChebyshevPoly" was closed with an 'end', but at least one other function definition was not. To avoid confusion when using nested functions, it is illegal to use both conventions in the same file.