Inspired by Problem 18, create a bullseye matrix with the addition of padding equal to 0 between concentric rings. Matrices are square with outer ring equal to input n.
n=1
1
n=2
2 2 2 2 2
2 0 0 0 2
2 0 1 0 2
2 0 0 0 2
2 2 2 2 2
n=3
3 3 3 3 3 3 3 3 3
3 0 0 0 0 0 0 0 3
3 0 2 2 2 2 2 0 3
3 0 2 0 0 0 2 0 3
3 0 2 0 1 0 2 0 3
3 0 2 0 0 0 2 0 3
3 0 2 2 2 2 2 0 3
3 0 0 0 0 0 0 0 3
3 3 3 3 3 3 3 3 3
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
Count from 0 to N^M in base N.
241 Solvers
-
1375 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
560 Solvers
-
Implement a bubble sort technique and output the number of swaps required
398 Solvers
-
Determine if Input is Oddish or Evenish (Odd/Even Sum of Digits)
331 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!