Cody

Problem 45173. Create the flag of Ramumbia

Solution 2082546

Submitted on 7 Jan 2020 by Petr
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
L = 1; W=3; y_correct(:,:,1) = [1,0,0]; y_correct(:,:,2) = [0,1,0]; y_correct(:,:,3) = [0,0,1]; assert(isequal(RamumbiaFlag(L,W),y_correct))

2   Pass
L = 3; W = 8; y_correct = zeros(L,W,3); assert(isequal(RamumbiaFlag(L,W),y_correct))

3   Pass
L = 10; W = 27; y_correct(:,:,1) = [ones(10,9),zeros(10,9),zeros(10,9)]; y_correct(:,:,2) = [zeros(10,9),ones(10,9),zeros(10,9)]; y_correct(:,:,3) = [zeros(10,9),zeros(10,9),ones(10,9)]; assert(isequal(RamumbiaFlag(L,W),y_correct))

4   Pass
L = 1000; W = 12119; y_correct = zeros(L,W,3); assert(isequal(RamumbiaFlag(L,W),y_correct))

5   Pass
L = 100; W = 999; y_correct(:,:,1) = [ones(100,333),zeros(100,333),zeros(100,333)]; y_correct(:,:,2) = [zeros(100,333),ones(100,333),zeros(100,333)]; y_correct(:,:,3) = [zeros(100,333),zeros(100,333),ones(100,333)]; assert(isequal(RamumbiaFlag(L,W),y_correct))

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!