Problem 2455. Diagonal of a Spiral Matrix

Solution 1696613

Submitted on 19 Dec 2018 by Mu
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
a = diag(spiral(4)); b = digSpi(4); assert(isequal(a,b));

2   Pass
a = diag(spiral(5)); b = digSpi(5); assert(isequal(a,b));

3   Pass
a = diag(spiral(6)); b = digSpi(6); assert(isequal(a,b));

4   Pass
a = diag(spiral(7)); b = digSpi(7); assert(isequal(a,b));

5   Pass
a = diag(spiral(8)); b = digSpi(8); assert(isequal(a,b));

Suggested Problems

More from this Author44

Community Treasure Hunt

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

Start Hunting!