Problem 45173. Create the flag of Ramumbia
The little known nation of Ramumbia has a very simple flag. It is made up of vertical stripes, Red, Green, Blue, that are equally spaced and with no gap between said stripes.
The artist that designed the flag has been very clear; "If the flag is not divisible into three, equal, vertical segments, this flag shall not exist!" However, bizarrely, the designer has given no guidance on the aspect ratio of the flag.
Your task is to write a function which can reproduce said flag as a hypermatrix, viewable by the "imshow" function. The inputs to the function are the length, L and width, W of the flag, but remember, unless the width is divisible by three with no remainders, the flag will be blank (i.e. a hypermatrix of zeros of the appropriate size)
Solution Stats
Problem Comments
-
4 Comments
Show
1 older comment
William
on 14 Oct 2019
There are some problems with the test suite. Problems 3 and 5 have too many square brackets on the right, and Problem 4 uses a matrix that exceeds the preferred matrix dimensions.
ME
on 17 Oct 2019
I find the exact same problem with the test suite.
David Motson
on 5 Nov 2019
Please correct the test suite. I believe that I have submitted a correct solution
goc3
on 28 Sep 2020
The test suite has been corrected.
Solution Comments
Show commentsProblem Recent Solvers14
Suggested Problems
-
1599 Solvers
-
17110 Solvers
-
Make an awesome ramp for a tiny motorcycle stuntman
654 Solvers
-
How long is the longest prime diagonal?
396 Solvers
-
Unique values without using UNIQUE function
354 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!