Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 1;
y_correct = ones(3);
assert(isequal(surrounded(x),y_correct))
|
2 | Pass |
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))
|
3 | Pass |
x = ones(3,4);
y_correct = ones(5,6);
assert(isequal(surrounded(x),y_correct))
|
4 | Pass |
x = [0];
y_correct = ones(3); y_correct(2,2) = 0;
assert(isequal(surrounded(x),y_correct))
|
5 | Pass |
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))
|
1223 Solvers
Find common elements in matrix rows
1232 Solvers
248 Solvers
Project Euler: Problem 6, Natural numbers, squares and sums.
1018 Solvers
Find nearest prime number less than input number
268 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!