Cody

# Problem 2493. Must be in the front row...

Solution 1223518

Submitted on 1 Jul 2017 by Augusto Mazzei
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   Pass
matrix=magic(4); value=6; y_correct=[6 12 9 7; 15 1 4 14; 3 13 16 2; 10 8 5 11]; assert(isequal(front_row(matrix,value),y_correct))

R = 3 C = 3 m = 9 7 6 12 4 14 15 1 16 2 3 13 5 11 10 8 m = 6 12 9 7 15 1 4 14 3 13 16 2 10 8 5 11

2   Pass
matrix=magic(5); value=3; matrix(3,2)=value; y_correct=[3 13 20 22 4; 12 19 21 3 10; 18 25 2 9 11; 24 1 8 15 17; 5 7 14 16 23]; assert(isequal(front_row(matrix,value),y_correct))

R = 3 4 C = 2 5 m = 4 3 13 20 22 10 12 19 21 3 11 18 25 2 9 17 24 1 8 15 23 5 7 14 16 m = 3 13 20 22 4 12 19 21 3 10 18 25 2 9 11 24 1 8 15 17 5 7 14 16 23

3   Pass
matrix=magic(7); value=500; assert(isequal(front_row(matrix,value),matrix))

R = 0×1 empty double column vector C = 0×1 empty double column vector

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!