This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
M=magic(5);
y_correct = [9, 24,1,8 ,15; 23 ,21,7,14,16; 4,6,13,20,22; 10,12,19,5,3; 11,18,25,2,17];
assert(isequal(flipDiagonal(M),y_correct))
y =
9 24 1 8 15
23 21 7 14 16
4 6 13 20 22
10 12 19 5 3
11 18 25 2 17
|
2 | Pass |
m=magic(2);
y_correct=[2 3; 4 1];
assert(isequal(flipDiagonal(m),y_correct))
y =
2 3
4 1
|
Replace multiples of 5 with NaN
358 Solvers
246 Solvers
convert matrix to single column
306 Solvers
2455 Solvers
569 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!