Cody

Solution 1222292

Submitted on 29 Jun 2017
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
filetext = fileread('dec_2_binvec.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp() and its family are forbidden') assert(isempty(strfind(filetext, 'dec2binvec')),'dec2binvec() forbidden') assert(isempty(strfind(filetext, 'num2str')),'num2str() forbidden') assert(isempty(strfind(filetext, 'regexprep')),'regexprep() forbidden') assert(isempty(strfind(filetext, 'for')),'for() forbidden') assert(isempty(strfind(filetext, 'while')),'while() forbidden') assert(isempty(strfind(filetext, 'if')),'if() forbidden') assert(isempty(strfind(filetext, 'mrdivide')),'mrdivide() forbidden') assert(isempty(strfind(filetext, 'mldivide')),'mldivide() forbidden') assert(isempty(strfind(filetext, '\')),'\ forbidden') assert(isempty(strfind(filetext, '/')),'/ forbidden') assert(isempty(strfind(filetext, '^')),'^ forbidden') assert(isempty(strfind(filetext, 'rem')),'rem() forbidden') assert(isempty(strfind(filetext, 'mod')),'mod() forbidden') assert(isempty(strfind(filetext, 'java')),'java forbidden')

2   Fail
x = 1; assert(isequal(dec_2_binvec(x),1))

Undefined function 'dec3bin' for input arguments of type 'double'. Error in dec_2_binvec (line 2) y = flip(dec3bin(x) - '0'); Error in TestPoint2 (line 2) assert(isequal(dec_2_binvec(x),1))

3   Fail
x = 5; assert(isequal(dec_2_binvec(x),[1 0 1]))

Undefined function 'dec3bin' for input arguments of type 'double'. Error in dec_2_binvec (line 2) y = flip(dec3bin(x) - '0'); Error in TestPoint3 (line 2) assert(isequal(dec_2_binvec(x),[1 0 1]))

4   Fail
x = 1000; assert(isequal(dec_2_binvec(x),[0 0 0 1 0 1 1 1 1 1]))

Undefined function 'dec3bin' for input arguments of type 'double'. Error in dec_2_binvec (line 2) y = flip(dec3bin(x) - '0'); Error in TestPoint4 (line 2) assert(isequal(dec_2_binvec(x),[0 0 0 1 0 1 1 1 1 1]))

5   Fail
x = 2700; assert(isequal(dec_2_binvec(x),[0 0 1 1 0 0 0 1 0 1 0 1]))

Undefined function 'dec3bin' for input arguments of type 'double'. Error in dec_2_binvec (line 2) y = flip(dec3bin(x) - '0'); Error in TestPoint5 (line 2) assert(isequal(dec_2_binvec(x),[0 0 1 1 0 0 0 1 0 1 0 1]))

6   Fail
x = 8210; assert(isequal(dec_2_binvec(x),[0 1 0 0 1 0 0 0 0 0 0 0 0 1]))

Undefined function 'dec3bin' for input arguments of type 'double'. Error in dec_2_binvec (line 2) y = flip(dec3bin(x) - '0'); Error in TestPoint6 (line 2) assert(isequal(dec_2_binvec(x),[0 1 0 0 1 0 0 0 0 0 0 0 0 1]))

7   Fail
x = 44580; assert(isequal(dec_2_binvec(x),[0 0 1 0 0 1 0 0 0 1 1 1 0 1 0 1]))

Undefined function 'dec3bin' for input arguments of type 'double'. Error in dec_2_binvec (line 2) y = flip(dec3bin(x) - '0'); Error in TestPoint7 (line 2) assert(isequal(dec_2_binvec(x),[0 0 1 0 0 1 0 0 0 1 1 1 0 1 0 1]))