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
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
-
Project Euler: Problem 16, Sums of Digits of Powers of Two
141 Solvers
-
400 Solvers
-
Calculate the Hamming distance between two strings
324 Solvers
-
542 Solvers
-
Accessing elements on the diagonal
103 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!