Cody

Solution 175851

Submitted on 11 Dec 2012 by J.R.! Menzinger
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
m=5; Start=rand(m,2); Final=rand(m,2); d=xy_distance(Start,Final); d=round(100*d)/100; d_expect=zeros(m); for i=1:m % 10 for j=1:m dx=Start(i,1)-Final(j,1); % 14 dy=Start(i,2)-Final(j,2); % 14 d_expect(i,j)=hypot(dx,dy); % 14 end end d_expect=round(100*d_expect)/100; assert(isequal(d_expect,d))
ans = 0.4686 0.1044 0.3835 0.8296 0.4125 0.7092 0.6394 0.5897 1.0335 0.3354 0.3962 0.9045 0.5183 0.1187 0.9515 0.3236 0.8203 0.4208 0.2447 0.8281 0.0199 0.5133 0.1531 0.3804 0.6045