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 404313

Submitted on 14 Feb 2014 by J-G van der Toorn

Correct

53Size
Leading solution size is 17.
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
 
%%
W=200
L=400
CL=3
CW=6
y_correct = 2239;
assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))
W =
   200
L =
   400
CL =
     3
CW =
     6
2
Pass
 
%%
W=100
L=200
CL=2
CW=3
y_correct = 623;
assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))
W =
   100
L =
   200
CL =
     2
CW =
     3