Problem 50887. Draw a '8' in a zero matrix!
Given a x-by-x matrix filled with zeros (x is odd and > 3). Use 8s to draw a number 8 into it! Like this:
x = 5, y =
8 8 8 8 8
8 0 0 0 8
8 8 8 8 8
8 0 0 0 8
8 8 8 8 8
x = 7, y =
8 8 8 8 8 8 8
8 0 0 0 0 0 8
8 0 0 0 0 0 8
8 8 8 8 8 8 8
8 0 0 0 0 0 8
8 0 0 0 0 0 8
8 8 8 8 8 8 8
Solution Stats
Problem Comments
-
2 Comments
Szász Botond
on 10 Mar 2021
Please like it if it wasinteresting!
Tran Tran
on 5 May 2022
There is a very interesting solution that is create 7 segements on your array like a "7-segment Display"
https://www.electronics-tutorials.ws/blog/7-segment-display-tutorial.html
This way may seem more complicated but once you has the data of segements' coordinate on your matrix you can automate other solution in this group easily.
So i can call it is a master solution
Solution Comments
Show commentsGroup

University Union CODY event
- 14 Problems
- 9 Finishers
- Times 2 - START HERE
- Calculate Amount of Cake Frosting
- Convert from Fahrenheit to Celsius
- Find the Oldest Person in a Room
- Solve a System of Linear Equations
- Calculate a Damped Sinusoid
- Plot Damped Sinusoid
- Crop an Image
- Find the Best Hotels
- Calculate Inner Product
- Rescale Scores
- Longest run of consecutive numbers
- Find the longest sequence of 1's in a binary sequence.
- Draw a '8' in a zero matrix!
Problem Recent Solvers528
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!