Test  Status  Code Input and Output 

1  Pass 
nList = 28:6:76;
for i = 1:length(nList)
n = nList(i);
[p1,p2] = goldbach(n)
assert(isprime(p1) && isprime(p2) && (p1+p2==n));
end
a =
2 3 5 7 11 13 17 19 23
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
5
p2 =
23
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
11
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
5
p1 =
23
p2 =
5
a =
2 3 5 7 11 13 17 19 23 29 31
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
31
b =
0
c =
logical
1
p1 =
5
p2 =
29
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
23
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
11
b =
0
c =
logical
1
p1 =
29
p2 =
5
b =
0
c =
logical
1
p1 =
31
p2 =
3
p1 =
31
p2 =
3
a =
2 3 5 7 11 13 17 19 23 29 31 37
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
37
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
29
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
23
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
17
b =
0
c =
logical
1
p1 =
29
p2 =
11
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
37
p2 =
3
p1 =
37
p2 =
3
a =
2 3 5 7 11 13 17 19 23 29 31 37 41 43
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
43
b =
0
c =
logical
1
p1 =
5
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
29
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
23
b =
0
c =
logical
1
p1 =
29
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
5
b =
0
c =
logical
1
p1 =
43
p2 =
3
p1 =
43
p2 =
3
a =
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
5
p2 =
47
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
29
b =
0
c =
logical
1
p1 =
29
p2 =
23
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
11
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
5
p1 =
47
p2 =
5
a =
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
5
p2 =
53
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
47
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
29
p2 =
29
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
11
b =
0
c =
logical
1
p1 =
53
p2 =
5
p1 =
53
p2 =
5
a =
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
61
b =
0
c =
logical
1
p1 =
5
p2 =
59
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
53
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
47
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
23
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
17
b =
0
c =
logical
1
p1 =
53
p2 =
11
b =
0
c =
logical
1
p1 =
59
p2 =
5
b =
0
c =
logical
1
p1 =
61
p2 =
3
p1 =
61
p2 =
3
a =
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
67
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
59
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
53
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
47
b =
0
c =
logical
1
p1 =
29
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
29
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
23
b =
0
c =
logical
1
p1 =
53
p2 =
17
b =
0
c =
logical
1
p1 =
59
p2 =
11
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
67
p2 =
3
p1 =
67
p2 =
3
a =
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
73
b =
0
c =
logical
1
p1 =
5
p2 =
71
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
59
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
53
b =
0
c =
logical
1
p1 =
29
p2 =
47
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
29
b =
0
c =
logical
1
p1 =
53
p2 =
23
b =
0
c =
logical
1
p1 =
59
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
71
p2 =
5
b =
0
c =
logical
1
p1 =
73
p2 =
3
p1 =
73
p2 =
3

2  Pass 
nList = [18 20 22 100 102 114 1000 2000 36 3600];
for i = 1:length(nList)
n = nList(i);
[p1,p2] = goldbach(n)
assert(isprime(p1) && isprime(p2) && (p1+p2==n));
end
a =
2 3 5 7 11 13 17
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
5
p2 =
13
b =
0
c =
logical
1
p1 =
7
p2 =
11
b =
0
c =
logical
1
p1 =
11
p2 =
7
b =
0
c =
logical
1
p1 =
13
p2 =
5
b =
0
c =
logical
0
p1 =
13
p2 =
5
a =
2 3 5 7 11 13 17 19
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
7
p2 =
13
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
13
p2 =
7
b =
0
c =
logical
1
p1 =
17
p2 =
3
b =
0
c =
logical
0
p1 =
17
p2 =
3
a =
2 3 5 7 11 13 17 19
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
19
b =
0
c =
logical
1
p1 =
5
p2 =
17
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
11
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
5
b =
0
c =
logical
1
p1 =
19
p2 =
3
p1 =
19
p2 =
3
a =
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
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
97
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
11
p2 =
89
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
83
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
29
p2 =
71
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
59
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
53
b =
0
c =
logical
1
p1 =
53
p2 =
47
b =
0
c =
logical
1
p1 =
59
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
71
p2 =
29
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
83
p2 =
17
b =
0
c =
logical
1
p1 =
89
p2 =
11
b =
0
c =
logical
1
p1 =
97
p2 =
3
p1 =
97
p2 =
3
a =
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 101
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
5
p2 =
97
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
13
p2 =
89
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
19
p2 =
83
b =
0
c =
logical
1
p1 =
23
p2 =
79
b =
0
c =
logical
1
p1 =
29
p2 =
73
b =
0
c =
logical
1
p1 =
31
p2 =
71
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
61
b =
0
c =
logical
1
p1 =
43
p2 =
59
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
59
p2 =
43
b =
0
c =
logical
1
p1 =
61
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
71
p2 =
31
b =
0
c =
logical
1
p1 =
73
p2 =
29
b =
0
c =
logical
1
p1 =
79
p2 =
23
b =
0
c =
logical
1
p1 =
83
p2 =
19
b =
0
c =
logical
1
p1 =
89
p2 =
13
b =
0
c =
logical
1
p1 =
97
p2 =
5
b =
0
c =
logical
0
p1 =
97
p2 =
5
a =
Columns 1 through 29
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 101 103 107 109
Column 30
113
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
5
p2 =
109
b =
0
c =
logical
1
p1 =
7
p2 =
107
b =
0
c =
logical
1
p1 =
11
p2 =
103
b =
0
c =
logical
1
p1 =
13
p2 =
101
b =
0
c =
logical
1
p1 =
17
p2 =
97
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
31
p2 =
83
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
41
p2 =
73
b =
0
c =
logical
1
p1 =
43
p2 =
71
b =
0
c =
logical
1
p1 =
47
p2 =
67
b =
0
c =
logical
1
p1 =
53
p2 =
61
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
61
p2 =
53
b =
0
c =
logical
1
p1 =
67
p2 =
47
b =
0
c =
logical
1
p1 =
71
p2 =
43
b =
0
c =
logical
1
p1 =
73
p2 =
41
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
83
p2 =
31
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
97
p2 =
17
b =
0
c =
logical
1
p1 =
101
p2 =
13
b =
0
c =
logical
1
p1 =
103
p2 =
11
b =
0
c =
logical
1
p1 =
107
p2 =
7
b =
0
c =
logical
1
p1 =
109
p2 =
5
b =
0
c =
logical
0
p1 =
109
p2 =
5
a =
Columns 1 through 29
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 101 103 107 109
Columns 30 through 58
113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271
Columns 59 through 87
277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449
Columns 88 through 116
457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641
Columns 117 through 145
643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829
Columns 146 through 168
839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
3
p2 =
997
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
17
p2 =
983
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
23
p2 =
977
b =
0
c =
logical
1
p1 =
29
p2 =
971
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
47
p2 =
953
b =
0
c =
logical
1
p1 =
53
p2 =
947
b =
0
c =
logical
1
p1 =
59
p2 =
941
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
71
p2 =
929
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
89
p2 =
911
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
113
p2 =
887
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
137
p2 =
863
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
173
p2 =
827
b =
0
c =
logical
1
p1 =
179
p2 =
821
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
191
p2 =
809
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
0
b =
0
c =
logical
1
p1 =
227
p2 ...

38720 Solvers
How to find the position of an element in a vector without using the find function
2348 Solvers
542 Solvers
419 Solvers
200 Solvers