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 Solvers12
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9158 Solvers
-
Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
140 Solvers
-
Magic is simple (for beginners)
11562 Solvers
-
Find the definite integral of various linear functions
62 Solvers
-
How long do each of the stages of the rocket take to burn?
491 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!