Cody

Solution 2186342

Submitted on 1 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   Pass
filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for command is forbidden') assert(isempty(strfind(filetext, 'while')),'while command is forbidden') assert(isempty(strfind(filetext, 'find')),'find command is forbidden') assert(isempty(strfind(filetext, 'repelem')),'repelem command is forbidden') assert(isempty(strfind(filetext, 'discretize')),'discretize command is forbidden') assert(isempty(strfind(filetext, 'str2num')),'str2num command is forbidden')

2   Fail
x = 23; y_correct = 3; assert(isequal(your_fcn_name(x),y_correct))

Assertion failed.

3   Fail
x = 1000; y_correct = 163; assert(isequal(your_fcn_name(x),y_correct))

Assertion failed.

4   Fail
x = 10000; y_correct = 1224; assert(isequal(your_fcn_name(x),y_correct))

Assertion failed.

5   Fail
x = 9999999; y_correct = 664574; assert(isequal(your_fcn_name(x),y_correct))

Assertion failed.