MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance. If input xyz =[3 4 2; 0 0 2; 0 1 2; 1 1 2; 1 1 20] then output w=25.

169 correct solutions
74 incorrect solutions

Last solution submitted on Mar 27, 2015

2 players like this problem

2 Comments

Michael
on 27 Jan 2012

Brilliant!

dangee
on 23 Jul 2012

Can you explain the problem. Walking from [3 4 2] to [0 0 2] gives (3-0)+(4-0) = 7 units. Then from [0 0 2] to [0 1 2] gives 1 unit. From [0 1 2] to [1 1 2] gives 1 unit and finally from [1 1 2] to [1 1 20] gives 18 units. So sum of distance is 7+1+1+18 = 27. Is it right?

2 Comments