Cody

Solution 1938598

Submitted on 16 Sep 2019 by Augusto Mazzei
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('radialZernike.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; m = 0; P_correct = [1]; assert(isequal(radialZernike(n,m),P_correct));

P = 1

3   Pass
n = 1; m = 1; P_correct = [1 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0

4   Pass
n = 2; m = 0; P_correct = [2 0 -1]; assert(isequal(radialZernike(n,m),P_correct));

P = 2 0 -1

5   Pass
n = 2; m = 2; P_correct = [1 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0

6   Pass
n = 3; m = 1; P_correct = [3 0 -2 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 3 0 -2 0

7   Pass
n = 3; m = 3; P_correct = [1 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0

8   Pass
n = 4; m = 0; P_correct = [6 0 -6 0 1]; assert(isequal(radialZernike(n,m),P_correct));

P = 6 0 -6 0 1

9   Pass
n = 4; m = 2; P_correct = [4 0 -3 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 4 0 -3 0 0

10   Pass
n = 4; m = 4; P_correct = [1 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0 0

11   Pass
n = 5; m = 1; P_correct = [10 0 -12 0 3 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 10 0 -12 0 3 0

12   Pass
n = 5; m = 3; P_correct = [5 0 -4 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 5 0 -4 0 0 0

13   Pass
n = 5; m = 5; P_correct = [1 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0 0 0

14   Pass
n = 6; m = 0; P_correct = [20 0 -30 0 12 0 -1]; assert(isequal(radialZernike(n,m),P_correct));

P = 20 0 -30 0 12 0 -1

15   Pass
n = 6; m = 2; P_correct = [15 0 -20 0 6 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 15 0 -20 0 6 0 0

16   Pass
n = 6; m = 4; P_correct = [6 0 -5 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 6 0 -5 0 0 0 0

17   Pass
n = 6; m = 6; P_correct = [1 0 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0 0 0 0

18   Pass
n = 7; m = 1; P_correct = [35 0 -60 0 30 0 -4 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 35 0 -60 0 30 0 -4 0

19   Pass
n = 7; m = 3; P_correct = [21 0 -30 0 10 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 21 0 -30 0 10 0 0 0

20   Pass
n = 7; m = 5; P_correct = [7 0 -6 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 7 0 -6 0 0 0 0 0

21   Pass
n = 7; m = 7; P_correct = [1 0 0 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0 0 0 0 0

22   Pass
n = 8; m = 0; P_correct = [70 0 -140 0 90 0 -20 0 1]; assert(isequal(radialZernike(n,m),P_correct));

P = 70 0 -140 0 90 0 -20 0 1

23   Pass
n = 8; m = 2; P_correct = [56 0 -105 0 60 0 -10 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 56 0 -105 0 60 0 -10 0 0

24   Pass
n = 8; m = 4; P_correct = [28 0 -42 0 15 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 28 0 -42 0 15 0 0 0 0

25   Pass
n = 8; m = 6; P_correct = [8 0 -7 0 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 8 0 -7 0 0 0 0 0 0

26   Pass
n = 8; m = 8; P_correct = [1 0 0 0 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0 0 0 0 0 0

27   Pass
n = 9; m = 1; P_correct = [126 0 -280 0 210 0 -60 0 5 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 126 0 -280 0 210 0 -60 0 5 0

28   Pass
n = 9; m = 3; P_correct = [84 0 -168 0 105 0 -20 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 84 0 -168 0 105 0 -20 0 0 0

29   Pass
n = 9; m = 5; P_correct = [36 0 -56 0 21 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 36 0 -56 0 21 0 0 0 0 0

30   Pass
n = 9; m = 7; P_correct = [9 0 -8 0 0 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 9 0 -8 0 0 0 0 0 0 0

31   Pass
n = 9; m = 9; P_correct = [1 0 0 0 0 0 0 0 0 0]; assert(isequal(radialZernike(n,m),P_correct));

P = 1 0 0 0 0 0 0 0 0 0