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 216924

Submitted on 13 Mar 2013 by Alfonso Nieto-Castanon

Correct

55Size
Leading solution size is 40.
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
 
%%
HM =  [1 1 0 1 0 0 0 1 1 0 1 1 0 0 0];
trk = [0 0 0 1 1 1 1 1 1 1 1 1 1 1 1];
assert(isequal(TrkState(HM),trk))

                    
2
Pass
 
%%
HM =  [1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0];
trk = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1];
assert(isequal(TrkState(HM),trk))

                    
3
Pass
 
%%
HM =  [1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1];
trk = [0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1];
assert(isequal(TrkState(HM),trk))