Cody

Solution 1698293

Submitted on 21 Dec 2018
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   Pass
user_solution = fileread('hermite_poly.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')));

2   Pass
n = 0; P_correct = [1]; assert(isequal(hermite_poly(n),P_correct));

p = 1

3   Pass
n = 1; P_correct = [2 0]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0

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

p = 2 0 p = 1 p = 2 -2 -2

Assertion failed.

5   Fail
n = 3; P_correct = [8 0 -12 -0]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test5 (line 3) assert(isequal(hermite_poly(n),P_correct));

6   Fail
n = 4; P_correct = [16 0 -48 -0 12]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test6 (line 3) assert(isequal(hermite_poly(n),P_correct));

7   Fail
n = 5; P_correct = [32 0 -160 -0 120 0]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test7 (line 3) assert(isequal(hermite_poly(n),P_correct));

8   Fail
n = 6; P_correct = [64 0 -480 -0 720 0 -120]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test8 (line 3) assert(isequal(hermite_poly(n),P_correct));

9   Fail
n = 7; P_correct = [128 0 -1344 -0 3360 0 -1680 -0]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test9 (line 3) assert(isequal(hermite_poly(n),P_correct));

10   Fail
n = 8; P_correct = [256 0 -3584 -0 13440 0 -13440 -0 1680]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test10 (line 3) assert(isequal(hermite_poly(n),P_correct));

11   Fail
n = 9; P_correct = [512 0 -9216 -0 48384 0 -80640 -0 30240 0]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test11 (line 3) assert(isequal(hermite_poly(n),P_correct));

12   Fail
n = 10; P_correct = [1024 0 -23040 -0 161280 0 -403200 -0 302400 0 -30240]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test12 (line 3) assert(isequal(hermite_poly(n),P_correct));

13   Fail
n = 11; P_correct = [2048 0 -56320 -0 506880 0 -1774080 -0 2217600 0 -665280 -0]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test13 (line 3) assert(isequal(hermite_poly(n),P_correct));

14   Fail
n = 12; P_correct = [4096 0 -135168 -0 1520640 0 -7096320 -0 13305600 0 -7983360 -0 665280]; assert(isequal(hermite_poly(n),P_correct));

p = 2 0 p = 1 p = 2 -2 -2 p = 2 0

Matrix dimensions must agree. Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in hermite_poly (line 9) p = 2*conv([1 0], hermite_poly(n-1)) - 2*(n-1)*hermite_poly(n-2) Error in Test14 (line 3) assert(isequal(hermite_poly(n),P_correct));

Suggested Problems

More from this Author18