Cody

# Problem 1476. Radial Zernike polynomials

Solution 2200657

Submitted on 8 Apr 2020 by Benjamin Richards
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

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

R = 1

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

R = 1 0

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

R = 2 0 -1

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

R = 1 0 0

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

R = 3 0 -2 0

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

R = 1 0 0 0

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

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 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));

R = 1 0 0 0 0 0 0 0 0 0

### Community Treasure Hunt

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

Start Hunting!