Cody

Solution 167480

Submitted on 24 Nov 2012
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
%% C = [1 1 1 0 0 0 0 0 0 1 0 1]; K = 2; [A,B] = ebmf(C,K); assert(isequal(A*B,C)) assert(isequal(unique(A),[0; 1])) assert(isequal(unique(B),[0; 1])) assert(all(size(A)==[size(C,1),K])) assert(all(size(B)==[K,size(C,2)]))
Error: Assertion failed.
2   Pass
%% C = [1 0 0 1 0 0 1 1 0]; K = 3; [A,B] = ebmf(C,K); assert(isequal(A*B,C)) assert(isequal(unique(A),[0; 1])) assert(isequal(unique(B),[0; 1])) assert(all(size(A)==[size(C,1),K])) assert(all(size(B)==[K,size(C,2)]))
3   Fail
%% C = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; K = 1; [A,B] = ebmf(C,K); assert(isequal(A*B,C)) assert(isequal(unique(A),[0; 1])) assert(isequal(unique(B'),[0; 1])) assert(all(size(A)==[size(C,1),K])) assert(all(size(B)==[K,size(C,2)]))
Error: Assertion failed.
4   Fail
%% Added another small test case C = [1 0 1 1 1 1 0 1 0]; K = 2; [A,B] = ebmf(C,K); assert(isequal(A*B,C)) assert(isequal(unique(A),[0; 1])) assert(isequal(unique(B'),[0; 1])) assert(all(size(A)==[size(C,1),K])) assert(all(size(B)==[K,size(C,2)]))
Error: Assertion failed.
5   Fail
%% A degenerate problem C = [0 0 1 0 0 0 0 0 1]; K = 2; [A,B] = ebmf(C,K); assert(isequal(A*B,C)) assert(isequal(unique(A),[0; 1])) assert(isequal(unique(B'),[0; 1])) assert(all(size(A)==[size(C,1),K])) assert(all(size(B)==[K,size(C,2)]))
Error: Assertion failed.