Cody

Problem 46928. PRIME GENERATOR

Solution 3292668

Submitted on 20 Oct 2020 by ChrisR
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
n = 1; y_correct = []; assert(isequal(prime_generator(n),y_correct))

2   Pass
n = 5; y_correct = [2 3 5]; assert(isequal(prime_generator(n),y_correct))

3   Pass
n = 30; y_correct = [2 3 5 7 11 13 17 19 23 29]; assert(isequal(prime_generator(n),y_correct))

4   Pass
n = 100; y_correct = [2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97]; assert(isequal(prime_generator(n),y_correct))

Suggested Problems

Community Treasure Hunt

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

Start Hunting!