Cody

Problem 1113. Create array of all Distances between two Sets of Points

Solution 528236

Submitted on 13 Nov 2014
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   Fail
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))

Error: Undefined function 'dist' for input arguments of type 'double'.

Suggested Problems

More from this Author246

Community Treasure Hunt

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

Start Hunting!