Problem 43687. Change on Spiral Matrix

n>=3, generate a matrix of nth such that n^2 is the max number, and max number must be in [1,1] or [end, end]. One example will be suggested below: Example : n=4 answer : 10 9 8 7 11 2 1 6 12 3 4 5 13 14 15 16

Solution Stats

75.58% Correct | 24.42% Incorrect
Last Solution submitted on Dec 21, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers57

Suggested Problems

Community Treasure Hunt

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

Start Hunting!