Cody

Solution 1698561

Submitted on 22 Dec 2018 by HH
  • Size: 9
  • This is the leading solution.
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
v = 1:5; u = [2 4]; w = [0 -1]; y = insert_some(v,w,u); y_correct = [1 0 2 3 -1 4 5]; assert(isequal(y,y_correct)) filetext = fileread('insert_some.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp* command is forbidden'); assert(isempty(strfind(filetext, 'eval')),'eval* command is forbidden'); assert(isempty(strfind(filetext, 'inline')),'inline command is forbidden');

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In insert_some (line 2) In ScoringEngineTestPoint1 (line 4) In solutionTest (line 3)]

2   Pass
v = 1:100; u = 1:100; w = 1:100; y = insert_some(v,w,u); y_correct = reshape(repmat(1:100,2,1),1,[]); assert(isequal(y,y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In insert_some (line 2) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)]

3   Pass
v = 0:99; u = 11:10:101; w = repmat(nan,1,10); y = insert_some(v,w,u); y_correct = reshape([reshape(v,10,[]);repmat(nan,1,10)],1,[]); assert(isequaln(y,y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In insert_some (line 2) In ScoringEngineTestPoint3 (line 4) In solutionTest (line 7)]

4   Pass
v = repmat(1:2,1,100); w = repmat(3,1,100); u = 3:2:201; y = insert_some(v,w,u); y_correct = repmat(1:3,1,100); assert(isequaln(y,y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In insert_some (line 2) In ScoringEngineTestPoint4 (line 4) In solutionTest (line 9)]