Cody

Solution 2208971

Submitted on 13 Apr 2020
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   Fail
filetext = fileread('regular.m'); assert(isempty(strfind(filetext, 'for'))) assert(isempty(strfind(filetext, 'while')))

Assertion failed.

2   Fail
A = 1; B = 1; assert(isequal(regular(A),B));

t = 0 1 0 1 1 0 t = 1 0 0 0 0 1 t = 0 0 0 1 0 0 t = 0 1 0 0 1 0 t = 0 1 1 1 0 0 t = 0 0 0 0 1 1 t = 0 0 1 0 0 0 t = 1 1 0 0 0 1 t = 0 0 0 0 1 1 t = 1 0 0 1 1 0 prob = 0.5000 0.3333 0.1667 0.3333 0.5000 0.3333 0.1667 0.5000 0.3333 0.5000

Output argument "B" (and maybe others) not assigned during call to "regular". Error in Test2 (line 3) assert(isequal(regular(A),B));

3   Fail
A = [2 6 5 3 5 6 3 7]; B = [1 2 3 1 3 2 2 3]; assert(isequal(regular(A),B));

t = 0 0 1 1 1 0 t = 0 0 0 1 1 1 t = 0 1 1 0 1 0 t = 0 1 0 1 0 0 t = 0 0 0 0 0 0 t = 0 0 1 0 0 1 t = 1 1 1 0 0 0 t = 1 0 0 0 1 1 t = 0 0 1 0 1 0 t = 1 1 0 0 0 0 prob = 0.5000 0.5000 0.5000 0.3333 0 0.3333 0.5000 0.5000 0.3333 0.3333

Output argument "B" (and maybe others) not assigned during call to "regular". Error in Test3 (line 9) assert(isequal(regular(A),B));

4   Fail
A = [10 2 4 4 2 4 5 6 8 1 6 5 10 3 9 9 9 5 5 5 9 10 3 7 8]; B = [4 1 2 2 2 1 2 4 5 1 2 2 5 1 5 3 3 3 3 3 3 4 1 4 4]; assert(isequal(regular(A),B));

t = 0 0 1 0 1 0 t = 0 1 1 0 0 1 t = 0 0 0 1 0 0 t = 1 1 1 0 1 0 t = 1 0 0 1 0 0 t = 0 1 0 0 1 1 t = 0 1 1 0 0 0 t = 0 1 0 1 1 0 t = 1 0 0 1 0 1 t = 0 1 0 0 1 0 prob = 0.3333 0.5000 0.1667 0.6667 0.3333 0.5000 0.3333 0.5000 0.5000 0.3333

Output argument "B" (and maybe others) not assigned during call to "regular". Error in Test4 (line 11) assert(isequal(regular(A),B));

5   Fail
A = randi(100,80,100); B = zeros(size(A)); for iter = 1:size(A,2) [~, ~, B(:, iter)] = unique(A(:,iter)); end assert(isequal(regular(A),B));

t = 0 1 0 0 0 0 t = 1 0 0 0 1 0 t = 0 0 1 0 0 1 t = 1 1 0 0 0 0 t = 1 0 1 0 1 1 t = 1 0 1 1 1 1 t = 0 0 0 0 0 0 t = 0 0 0 0 1 1 t = 0 0 1 0 0 0 t = 1 0 0 0 1 0 prob = 0.1667 0.3333 0.3333 0.3333 0.6667 0.8333 0 0.3333 0.1667 0.3333

Output argument "B" (and maybe others) not assigned during call to "regular". Error in Test5 (line 6) assert(isequal(regular(A),B));