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 297521

Submitted on 6 Aug 2013 by Peter Wittenberg

Correct

23Size
Leading solution size is 14.
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
 
%%
vm=[60 2; -30 4];
velo_correct=0;
assert(isequal(colli(vm),velo_correct))

                    
2
Pass
 
%%
vm=[60 2; -30 4; 100 2];
velo_correct=25;
assert(isequal(colli(vm),velo_correct))