Cody

Solution 1922961

Submitted on 5 Sep 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   Fail
filetext = fileread('addVecToMat.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')

Error in solution: Line: 4 Column: 60 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
mat = ones(2); v = 1:3; comb_correct = [1 1 inf; 1 1 inf; 1 2 3]; assert(isequal(addVecToMat(mat, v), comb_correct))

Error in solution: Line: 4 Column: 60 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

3   Fail
mat = ones(3, 4); v = [2 3]; comb_correct = [ones(3,4); 2 3 -inf -inf]; assert(isequal(addVecToMat(mat, v), comb_correct))

Error in solution: Line: 4 Column: 60 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
mat = ones(2); v = [2 3]; comb_correct = [1 1; 1 1; 2 3]; assert(isequal(addVecToMat(mat, v), comb_correct))

Error in solution: Line: 4 Column: 60 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

5   Fail
mat = ones(3); v = 1:6; comb_correct = [repmat([ones(1,3) inf(1,3)], 3, 1); 1:6]; assert(isequal(addVecToMat(mat, v), comb_correct))

Error in solution: Line: 4 Column: 60 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.