Test  Status  Code Input and Output 

1  Pass 
n = 4;
d = 2;
%p = isprime(spiral(n));imagesc(p)
assert(isequal(prime_spiral(n),d))
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
ans =
2

2  Pass 
n = 7;
d = 4;
assert(isequal(prime_spiral(n),d))
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
ans =
4

3  Pass 
n = 13;
d = 5;
assert(isequal(prime_spiral(n),d))
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
ans =
5

4  Pass 
n = 52;
d = 6;
assert(isequal(prime_spiral(n),d))
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
ans =
6

5  Pass 
n = 81;
d = 9;
assert(isequal(prime_spiral(n),d))
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
[Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.]
ans =
9

Return unique values without sorting
463 Solvers
Find a subset that divides the vector into equal halves
283 Solvers
How many trades represent all the profit?
454 Solvers
Matrix with different incremental runs
186 Solvers
Sum the entries of each column of a matrix which satisfy a logical condition.
107 Solvers