Cody

Solution 2006502

Submitted on 7 Nov 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
x = 1; y_correct = ones(3); assert(isequal(surrounded(x),y_correct))

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

2   Fail
x = [3 3 3;3 3 3]; y_correct = [1 1 1 1 1;1 3 3 3 1; 1 3 3 3 1; 1 1 1 1 1]; assert(isequal(surrounded(x),y_correct))

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

3   Fail
x = ones(3,4); y_correct = ones(5,6); assert(isequal(surrounded(x),y_correct))

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

4   Fail
x = [0]; y_correct = ones(3); y_correct(2,2) = 0; assert(isequal(surrounded(x),y_correct))

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

5   Fail
x = reshape(1:9,[3,3]); y_correct = [1 1 1 1 1; 1 1 2 3 1; ... 1 4 5 6 1; 1 7 8 9 1; 1 1 1 1 1]'; assert(isequal(surrounded(x),y_correct))

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

Suggested Problems

More from this Author9