Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = magic(7);
y_correct = [30 39 48 10 19 28
38 47 7 18 27 29
46 6 8 26 35 37
13 15 24 42 44 4
21 23 32 43 3 12
22 31 40 2 11 20];
assert(isequal(central_cross(x),y_correct))
k =
4
x =
30 39 48 1 10 19 28
38 47 7 9 18 27 29
46 6 8 17 26 35 37
13 15 24 33 42 44 4
21 23 32 41 43 3 12
22 31 40 49 2 11 20
x =
30 39 48 10 19 28
38 47 7 18 27 29
46 6 8 26 35 37
13 15 24 42 44 4
21 23 32 43 3 12
22 31 40 2 11 20
|
2 | Pass |
x = magic(3);
y_correct = [8 6
4 2];
assert(isequal(central_cross(x),y_correct))
k =
2
x =
8 1 6
4 9 2
x =
8 6
4 2
|
3 | Pass |
x = magic(1);
y_correct = [];
assert(isequal(central_cross(x),y_correct))
k =
1
x =
0×1 empty double column vector
x =
[]
|
1599 Solvers
Return the first and last character of a string
3453 Solvers
525 Solvers
331 Solvers
254 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!