Interesting! This error stems from using "Ix" in both function and sub-function. As I test my code in scripts not contained within a function I was missing it.
Why are parameters made available to sub-functions by default?
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
n = 4;
d = 2;
%p = isprime(spiral(n));imagesc(p)
assert(isequal(prime_spiral(n),d))
|
2 | Fail |
n = 7;
d = 4;
assert(isequal(prime_spiral(n),d))
|
3 | Fail |
n = 13;
d = 5;
assert(isequal(prime_spiral(n),d))
|
4 | Fail |
n = 52;
d = 6;
assert(isequal(prime_spiral(n),d))
|
5 | Fail |
n = 81;
d = 9;
assert(isequal(prime_spiral(n),d))
|
2500 Solvers
Back to basics 3 - Temp Directory
328 Solvers
365 Solvers
188 Solvers
411 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!