Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
assessFunctionAbsence({'regexp','regexpi','regexprep','str2num'},'FileName','top5primes.m')
|
2 | Pass |
x = 1:10;
y_correct = [7 5 3 2 NaN];
assert(isequaln(top5primes(x),y_correct))
t =
4
a =
7 5 3 2 NaN NaN NaN NaN NaN NaN
|
3 | Pass |
x = (1:2:100).';
y_correct = [97 89 83 79 73].';
assert(isequaln(top5primes(x),y_correct))
t =
24
a =
97
89
83
79
73
71
67
61
59
53
47
43
41
37
31
29
23
19
17
13
11
7
5
3
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
|
4 | Pass |
x = [17 6 3
13 8 17
1 2 5
5 3 7
7 11 2
31 7 6];
y_correct = [31 11 17
17 7 7
13 3 5
7 2 3
5 NaN 2];
assert(isequaln(top5primes(x),y_correct))
t =
5
t =
4
t =
5
|
5 | Pass |
x = interp1(magic(30).',1:5).';
y_correct = [877 733 863 719 881
829 701 751 173 769
797 139 59 157 29
89 107 43 109 13
73 NaN 11 61 NaN];
assert(isequaln(top5primes(x),y_correct))
t =
6
t =
4
t =
5
t =
5
t =
4
|
6 | Pass |
rng(0);
x = reshape(randperm(200,180),36,5);
y_correct = [163 181 173 197 193
71 179 149 191 157
23 167 113 139 151
19 131 101 83 137
NaN 109 67 73 127];
assert(isequaln(top5primes(x),y_correct))
t =
4
t =
12
t =
8
t =
10
t =
10
|
Project Euler: Problem 5, Smallest multiple
397 Solvers
Generate N equally spaced intervals between -L and L
563 Solvers
Reverse the elements of an array
687 Solvers
Mersenne Primes vs. All Primes
165 Solvers
Calculate Amount of Cake Frosting
7491 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!