Cody

Solution 1709804

Submitted on 18 Jan 2019
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))

Not enough input arguments. Error in dec_2_binvec (line 2) y=false(1,n) Error in Test2 (line 2) assert(isequal(dec_2_binvec(x),1))

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

Not enough input arguments. Error in dec_2_binvec (line 2) y=false(1,n) Error in Test3 (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]))

Not enough input arguments. Error in dec_2_binvec (line 2) y=false(1,n) Error in Test4 (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]))

Not enough input arguments. Error in dec_2_binvec (line 2) y=false(1,n) Error in Test5 (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]))

Not enough input arguments. Error in dec_2_binvec (line 2) y=false(1,n) Error in Test6 (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]))

Not enough input arguments. Error in dec_2_binvec (line 2) y=false(1,n) Error in Test7 (line 2) assert(isequal(dec_2_binvec(x),[0 0 1 0 0 1 0 0 0 1 1 1 0 1 0 1]))

Suggested Problems

More from this Author14