Solution 189615

Submitted on 11 Jan 2013
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
%% filetext = fileread('xy_dstnc.m'); assert(isempty(strfind(filetext, 'dist')))

2   Fail
%% m=5; Start=rand(m,2); Final=rand(m,2); d=xy_dstnc(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: Output argument "d" (and maybe others) not assigned during call to "/users/msssystem13/xy_dstnc.m>xy_dstnc".