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 267731

Submitted on 26 Jun 2013 by Mineralter

Correct

12Size
This is the leading solution.
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
 
%%
suspects = [431 543 211 911 436];
code = 211;
jokers = 1;
assert(isequal(mytest(suspects,code),jokers))
jokers =
     1
2
Pass
 
%%
suspects = [431 543 211 911 436];
code = 217;
jokers = 0;
assert(isequal(mytest(suspects,code),jokers))
jokers =
     0
3
Pass
 
%%
suspects = 100:200;
code = 160;
jokers = 1;
assert(isequal(mytest(suspects,code),jokers))
jokers =
     1
4
Pass
 
%%
suspects = [100 200 300 350 200];
code = 200;
jokers = 2;
assert(isequal(mytest(suspects,code),jokers))
jokers =
     2