Draw a '9' in a zero matrix! - MATLAB Cody - MATLAB Central

Problem 50897. Draw a '9' in a zero matrix!

Difficulty:Rate
Given a x-by-x matrix filled with zeros (x is odd and > 3). Use 9s to draw a number 9 into it! Like this:
x = 5, y =
9 9 9 9 9
9 0 0 0 9
9 9 9 9 9
0 0 0 0 9
9 9 9 9 9
x = 7, y =
9 9 9 9 9 9 9
9 0 0 0 0 0 9
9 0 0 0 0 0 9
9 9 9 9 9 9 9
0 0 0 0 0 0 9
0 0 0 0 0 0 9
9 9 9 9 9 9 9

Solution Stats

74.7% Correct | 25.3% Incorrect
Last Solution submitted on Mar 27, 2025

Problem Comments

Solution Comments

Show comments
Registration Now Open for MathWorks AUTOMOTIVE CONFERENCE 2025
...
Hello Community, We're excited to announce that registration is now open for the...

Problem Recent Solvers487

Suggested Problems

More from this Author12

Problem Tags

x

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page