Cody

Problem 1341. Track Logic

Solution 2316843

Submitted on 21 May 2020 by Fred Smith
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status 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))

Suggested Problems

More from this Author4

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!