Cody

Problem 44415. Remove the first, third and fifth rows of a matrix

Solution 2138945

Submitted on 24 Feb 2020 by Shahar Kalfon
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
x = [1 1 1; 2 2 2; 3 3 3; 4 4 4; 5 5 5; 6 6 6]; y_correct = [2 2 2; 4 4 4; 6 6 6]; assert(isequal(deleteThreeRows(x),y_correct))

x = 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 x = 2 2 2 4 4 4 5 5 5 6 6 6 x = 2 2 2 4 4 4 6 6 6 y = 2 2 2 4 4 4 6 6 6

2   Pass
x = (1:5)'; y_correct = [2;4]; assert(isequal(deleteThreeRows(x),y_correct))

x = 2 3 4 5 x = 2 4 5 x = 2 4 y = 2 4

3   Pass
x = ones(8); y_correct = ones(5, 8); assert(isequal(deleteThreeRows(x),y_correct))

x = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 y = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1