Bullseye Matrix - MATLAB Cody - MATLAB Central

Problem 18. Bullseye Matrix

Difficulty:Rate
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Examples:
Input n = 3
Output a is [ 2 2 2
2 1 2
2 2 2 ]
Input n = 5
Output a is [ 3 3 3 3 3
3 2 2 2 3
3 2 1 2 3
3 2 2 2 3
3 3 3 3 3 ]

Solution Stats

61.48% Correct | 38.52% Incorrect
Last Solution submitted on Mar 03, 2025

Problem Comments

Solution Comments

Show comments
Primes and Rough Numbers, Basic ideas
What is a rough number? What can they be used...
2
4

Problem Recent Solvers5970

Suggested Problems

More from this Author96

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page