Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 400207

Submitted on 10 Feb 2014 by J-G van der Toorn

Correct

47Size
Leading solution size is 23.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
x = [1 2; 1 7; 1 8; 1 6; 1 5];
y_correct = [1 2; 1 5];
assert(isequal(delete_rows(x),y_correct))

                    
2
Pass
 
%%
x = [1 5;1 2;3 40;3 55;3 62;3 74;3 36];
y_correct = [1 5;1 2;3 40;3 36];
assert(isequal(delete_rows(x),y_correct))

                    
3
Pass
 
%%
x = [1 5;1 2;3 40;3 55;5 4;5 3;5 9;5 7;5 2;5 1];
y_correct = [1 5;1 2;3 40;3 55;5 4;5 1];
assert(isequal(delete_rows(x),y_correct))

                    
4
Pass
 
%%
x = [1 5;1 4;1 2;3 40;3 43;3 55;3 68;4 20;4 19;4 14;4 22;4 23];
y_correct = [1 5;1 2;3 40;3 68;4 20;4 23];
assert(isequal(delete_rows(x),y_correct))

                    
5
Pass
 
%%
x = [1 5;1 4;1 2;3 40;3 43;3 55;3 68;4 20;4 19;4 14;4 22;4 23;5 4;5 7];
y_correct = [1 5;1 2;3 40;3 68;4 20;4 23;5 4; 5 7];
assert(isequal(delete_rows(x),y_correct))

                    
6
Pass
 
%%
x = [99 100; 99 105; 99 102];
y_correct = [99 100; 99 102];
assert(isequal(delete_rows(x),y_correct))

                    
7
Pass
 
%%
x = [99 100;99 105;99 102;95 10;95 15;95 13;86 192;86 187;86 65];
y_correct = [99 100;99 102;95 10;95 13;86 192;86 65];
assert(isequal(delete_rows(x),y_correct))

                    
8
Pass
 
%%
x = [99 100;99 105;99 102;95 10;95 15;95 13;86 192;86 187;86 65;79 1;79 2;79 0;79 4;79 5;79 0];
y_correct = [99 100;99 102;95 10;95 13;86 192;86 65;79 1;79 0;];
assert(isequal(delete_rows(x),y_correct))