Problem 59202. Bullseye Matrix with Zeros
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 commentsProblem Recent Solvers10
Suggested Problems
- 
         Return the 3n+1 sequence for n 8403 Solvers 
- 
         All your base are belong to us 561 Solvers 
- 
         Find the elements of a matrix according to a defined property. 90 Solvers 
- 
         
         387 Solvers 
- 
         Calculate the probability that at least two people in a group share the same birthday. 97 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!