Better bullseye matrix - MATLAB Cody - MATLAB Central

Problem 312. Better bullseye matrix

Difficulty:Rate

Problem 18 asks to create a bullseye matrix like this:

[ 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 ] 

But I think a better one would look like this:

[ 5 4 3 4 5
  4 3 2 3 4
  3 2 1 2 3
  4 3 2 3 4
  5 4 3 4 5 ]

Thus given n (always odd), return output a that has concentric rings of the numbers 1 through n around the center point.

Solution Stats

52.91% Correct | 47.09% Incorrect
Last Solution submitted on May 06, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Problem Recent Solvers237

Suggested Problems

More from this Author39

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