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

35.0% Correct | 65.0% Incorrect
Last Solution submitted on Dec 03, 2022

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers13

Suggested Problems

More from this Author3

Community Treasure Hunt

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

Start Hunting!