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 longest sequence of 1's in a binary sequence.
6811 Solvers
-
Numbers with prime factors 2, 3 and 5.
683 Solvers
-
Getting the indices from a vector
12263 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
14137 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
265 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!