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 449930

Submitted on 4 Jun 2014 by Ned Gulley

Correct

17Size
Leading solution size is 15.
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 4; 4 5 5; 8 9 1];;
y= [4 5 1];
assert(isequal(i_th_largest(x),y))

                    
2
Pass
 
%%
x=ones(1000,1000);
y=ones(1,1000);
assert(isequal(i_th_largest(x),y))

                    
3
Pass
 
%%
x=zeros(1000,1000);
y=zeros(1,1000);
assert(isequal(i_th_largest(x),y))

                    
4
Pass
 
%%
x=eye(1000);
y=[1 zeros(1,999)];
assert(isequal(i_th_largest(x),y))

                    
5
Pass
 
%%
x=[ 1 1 3 4; 2 5 5 7; 8 8 8 8; 1 0 0 1];
y= [4 5 8 0];
assert(isequal(i_th_largest(x),y))