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
-
Make a run-length companion vector
663 Solvers
-
Find Index of maximum Value and maximum Value of a vector
173 Solvers
-
The Answer to Life, the Universe, and Everything
588 Solvers
-
99 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
405 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!