Cody

Solution 2003541

Submitted on 5 Nov 2019
  • Size: 92
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   Fail
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))

Error: File: Test3.m Line: 3 Column: 56 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
L = 1000; W = 1211119; y_correct = zeros(L,W,3); assert(isequal(RamumbiaFlag(L,W),y_correct))

Error using zeros Requested 1000x1211119x3 (27.1GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information. Error in Test4 (line 2) y_correct = zeros(L,W,3);

5   Fail
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))

Error: File: Test5.m Line: 3 Column: 65 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.