Cody

# Problem 14. Find the numeric mean of the prime numbers in a matrix.

Solution 1206015

Submitted on 6 Jun 2017 by Md.Farhad Hassan
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
x = 3; y_correct = 3; assert(isequal(meanOfPrimes(x),y_correct))

r = 1 c = 1 sum = 0 tt = 0 i = 1 k = 0 j = 1 ans = 3 k = 1 tt = 1 sum = 3

2   Pass
x = [1 2 3]; y_correct = 2.5; assert(isequal(meanOfPrimes(x),y_correct))

r = 1 c = 3 sum = 0 tt = 0 i = 1 k = 0 j = 1 ans = 1 j = 2 ans = 2 k = 1 tt = 1 sum = 2 j = 3 ans = 3 k = 1 tt = 2 sum = 5

3   Pass
x = [3 3; 3 3]; y_correct = 3; assert(isequal(meanOfPrimes(x),y_correct))

r = 2 c = 2 sum = 0 tt = 0 i = 1 k = 0 j = 1 ans = 3 k = 1 tt = 1 sum = 3 j = 2 ans = 3 k = 1 tt = 2 sum = 6 i = 2 k = 0 j = 1 ans = 3 k = 1 tt = 3 sum = 9 j = 2 ans = 3 k = 1 tt = 4 sum = 12

4   Pass
x = [7 3 8 8]'; y_correct = 5; assert(isequal(meanOfPrimes(x),y_correct))

r = 4 c = 1 sum = 0 tt = 0 i = 1 k = 0 j = 1 ans = 7 k = 1 k = 1 k = 1 k = 1 k = 1 tt = 1 sum = 7 i = 2 k = 0 j = 1 ans = 3 k = 1 tt = 2 sum = 10 i = 3 k = 0 j = 1 ans = 8 i = 4 k = 0 j = 1 ans = 8