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 316958

Submitted on 9 Sep 2013 by Sky Sartorius

Correct

16Size
Leading solution size is 13.
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
 
%%
mat=rand(10,10);
r=3;
c=5;
ind=43;
assert(isequal(index(mat,r,c),ind))
ans =
    43
2
Pass
 
%%
mat=rand(3,24);
r=2;
c=22;
ind=65;
assert(isequal(index(mat,r,c),ind))
ans =
    65