Cody

Problem 312. Better bullseye matrix

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

68.32% Correct | 31.68% Incorrect
Last solution submitted on Dec 07, 2016

Tags

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more